-Werror=stringop-overflow -O3 returns false-positives on ppc64el

Bug #2013140 reported by Steve Langasek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-12 (Ubuntu)
New
Undecided
Unassigned

Bug Description

I have seen various ppc64el-specific build failures in lunar because of use of -Werror + -O3 and -Wstringop-overflow returing false positive results. E.g.:

[...]
mme_context.c: In function ‘mme_context_parse_config’:
mme_context.c:1237:66: error: writing 16 bytes into a region of size 5 [-Werror=stringop-overflow=]
 1237 | network_full_name->name[(i*2)+1] =
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 1238 | c_network_name[i];
      | ~~~~~~~~~~~~~~~~~
mme_context.c:29:22: note: at offset 804187 into destination object ‘self’ of size 804192
   29 | static mme_context_t self;
      | ^~~~
mme_context.c:1237:66: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]
 1237 | network_full_name->name[(i*2)+1] =
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 1238 | c_network_name[i];
      | ~~~~~~~~~~~~~~~~~
mme_context.c:29:22: note: at offset 804203 into destination object ‘self’ of size 804192
   29 | static mme_context_t self;
      | ^~~~
[...]

https://launchpad.net/ubuntu/+source/nextepc/0.3.10+nods-4.2/+build/24633802

There is no object of size 804192 here and these offsets appear to be fabricated out of whole cloth.

Revision history for this message
Steve Langasek (vorlon) wrote :

Note that either passing -Wno-error=stringop-overflow, or omitting -O3, is sufficient to work around this failure.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.