public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56966] New: [4.7 Regression] wrong warning with -Werror (wrong code without Werror?)
@ 2013-04-15 13:32 doko at gcc dot gnu.org
2013-04-15 17:34 ` [Bug c++/56966] " pinskia at gcc dot gnu.org
2013-05-15 13:32 ` rguenth at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: doko at gcc dot gnu.org @ 2013-04-15 13:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56966
Bug #: 56966
Summary: [4.7 Regression] wrong warning with -Werror (wrong
code without Werror?)
Classification: Unclassified
Product: gcc
Version: 4.7.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: doko@gcc.gnu.org
Created attachment 29874
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29874
preprocessed source
seen when building OpenJDK-7 on x86_64-linux-gnu, no reduced test case yet.
works with 4.6 and 4.8, and a 4.7 branch from march. trying to get one
revision.
g++-4.7 -fno-rtti -fno-exceptions -fcheck-new -fvisibility=hidden -g -O3
-fno-strict-aliasing -Werror -c g1BlockOffsetTable.ii
In file included from /usr/include/string.h:638:0,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/utilities/globalDefinitions_gcc.hpp:35,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/utilities/globalDefinitions.hpp:33,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/utilities/debug.hpp:29,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/runtime/globals.hpp:28,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/memory/allocation.hpp:28,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/memory/memRegion.hpp:28,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp:28,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.inline.hpp:28,
from
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp:26:
In function 'void* memset(void*, int, size_t)',
inlined from 'void
G1BlockOffsetSharedArray::_ZN24G1BlockOffsetSharedArray16set_offset_arrayEmmh.isra.8(unsigned
char*, size_t, size_t, unsigned char)' at
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.hpp:169:52,
inlined from 'void
G1BlockOffsetArray::set_remainder_to_point_to_start_incl(size_t, size_t)' at
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp:195:67,
inlined from 'void
G1BlockOffsetArray::_ZN18G1BlockOffsetArray31set_remainder_to_point_to_startEP8HeapWordS1_.part.55(HeapWord*,
HeapWord*)' at
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp:168:61,
inlined from 'void
G1BlockOffsetArray::set_remainder_to_point_to_start(HeapWord*, HeapWord*)' at
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp:369:1,
inlined from 'void G1BlockOffsetArray::alloc_block_work2(HeapWord**,
size_t*, HeapWord*, HeapWord*)' at
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp:510:53,
inlined from 'HeapWord*
G1BlockOffsetArray::forward_to_block_containing_addr_slow(HeapWord*, HeapWord*,
const void*)' at
/scratch/packages/openjdk/7u15/openjdk-7-7u17-2.3.8/build/zerovm/openjdk/hotspot/src/share/vm/gc_implementation/g1/g1BlockOffsetTable.cpp:394:59:
/usr/include/x86_64-linux-gnu/bits/string3.h:81:32: error: call to
'__warn_memset_zero_len' declared with attribute warning: memset used with
constant zero length parameter; this could be due to transposed parameters
[-Werror]
/usr/include/x86_64-linux-gnu/bits/string3.h:81:32: error: call to
'__warn_memset_zero_len' declared with attribute warning: memset used with
constant zero length parameter; this could be due to transposed parameters
[-Werror]
/usr/include/x86_64-linux-gnu/bits/string3.h:81:32: error: call to
'__warn_memset_zero_len' declared with attribute warning: memset used with
constant zero length parameter; this could be due to transposed parameters
[-Werror]
/usr/include/x86_64-linux-gnu/bits/string3.h:81:32: error: call to
'__warn_memset_zero_len' declared with attribute warning: memset used with
constant zero length parameter; this could be due to transposed parameters
[-Werror]
/usr/include/x86_64-linux-gnu/bits/string3.h:81:32: error: call to
'__warn_memset_zero_len' declared with attribute warning: memset used with
constant zero length parameter; this could be due to transposed parameters
[-Werror]
/usr/include/x86_64-linux-gnu/bits/string3.h:81:32: error: call to
'__warn_memset_zero_len' declared with attribute warning: memset used with
constant zero length parameter; this could be due to transposed parameters
[-Werror]
cc1plus: all warnings being treated as errors
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/56966] [4.7 Regression] wrong warning with -Werror (wrong code without Werror?)
2013-04-15 13:32 [Bug c++/56966] New: [4.7 Regression] wrong warning with -Werror (wrong code without Werror?) doko at gcc dot gnu.org
@ 2013-04-15 17:34 ` pinskia at gcc dot gnu.org
2013-05-15 13:32 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-04-15 17:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56966
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-04-15 17:34:20 UTC ---
I don't think this is wrong code at all. The warning is correct for the code
as given but wrong for memset in general.
The code looks like:
void set_offset_array(size_t left, size_t right, u_char offset) {
;
;
size_t num_cards = right - left + 1;
memset(&_offset_array[left], offset, num_cards);
}
....
num_cards is being turned into 0 which is fine in this case as optimization has
happened. The problem is the memset code is just bogus when it tries to see if
the length is 0.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/56966] [4.7 Regression] wrong warning with -Werror (wrong code without Werror?)
2013-04-15 13:32 [Bug c++/56966] New: [4.7 Regression] wrong warning with -Werror (wrong code without Werror?) doko at gcc dot gnu.org
2013-04-15 17:34 ` [Bug c++/56966] " pinskia at gcc dot gnu.org
@ 2013-05-15 13:32 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-15 13:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56966
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Also this is a glibc issue then.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-05-15 13:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-15 13:32 [Bug c++/56966] New: [4.7 Regression] wrong warning with -Werror (wrong code without Werror?) doko at gcc dot gnu.org
2013-04-15 17:34 ` [Bug c++/56966] " pinskia at gcc dot gnu.org
2013-05-15 13:32 ` rguenth at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).