[Bug c++/27292] New: ICE on casts on bitfields
trunk r113199, fixing bug 26534, introduced an ICE with this testcase: === Cut === enum ColorRole { WindowText, Button }; struct QPalette { ColorRole bg_role:8; bool hasBackground(); }; bool QPalette::hasBackground () { return (ColorRole (bg_role) != WindowText); } === Cut === internal compiler error: in build_c_cast, at cp/typeck.c:5433 Please submit a full bug report, with preprocessed source if appropriate. -- Summary: ICE on casts on bitfields Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27292
[Bug c++/27292] [4.2 regression] ICE on casts on bitfields
-- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||mmitchel at gcc dot gnu dot ||org Severity|normal |major Keywords||ice-on-valid-code Summary|ICE on casts on bitfields |[4.2 regression] ICE on ||casts on bitfields Version|unknown |4.2.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27292
[Bug c++/27292] [4.2 regression] ICE on casts on bitfields
--- Comment #6 from mueller at gcc dot gnu dot org 2006-04-25 11:46 --- the original testcase still ICEs. however now in gimplify.c:5492 -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27292
[Bug tree-optimization/26626] [4.2 Regression] ICE in in add_virtual_operand
--- Comment #24 from mueller at gcc dot gnu dot org 2006-05-03 13:02 --- closing as fixed then. Thanks ! -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26626
[Bug c++/27471] New: [4.2 Regression] ICE within build_c_cast cp/typeck.c:5434
Hi, due to the bitfield handling changes, C++ frontend now ICEs on this: === Cut=== struct A { unsigned a:8; }; extern void b(unsigned char); void breakme (A f) { b((unsigned char) f.a); } === Cut === bitfield-ice-1.cc: In function 'void breakme(A)': bitfield-ice-1.cc:7: internal compiler error: in build_c_cast, at cp/typeck.c:5434 Please submit a full bug report, with preprocessed source if appropriate. See http://gcc.gnu.org/bugs.html> for instructions. -- Summary: [4.2 Regression] ICE within build_c_cast cp/typeck.c:5434 Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27471
[Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
--- Comment #7 from mueller at gcc dot gnu dot org 2006-05-08 08:40 --- Ah, just missed it by a few minutes :) I've been using this patch: === CUT === --- c-common.c (revision 113532) +++ c-common.c (working copy) @@ -1077,7 +1077,7 @@ convert_and_check (tree type, tree expr) tree t = convert (type, expr); if (TREE_CODE (t) == INTEGER_CST) { - if (TREE_OVERFLOW (t)) + if (TREE_OVERFLOW (t) && CONSTANT_CLASS_P (expr)) { TREE_OVERFLOW (t) = 0; === CUT === and it seems to bootstrap and regtest fine (not closely checked against vanilla tree yet). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
[Bug tree-optimization/22303] CCP does not handle STRING_CSTs
--- Comment #5 from mueller at gcc dot gnu dot org 2006-05-08 10:06 --- I'll try taking care. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22303
[Bug tree-optimization/22303] CCP does not handle STRING_CSTs
-- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |mueller at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22303
[Bug c++/27505] New: ICE in const folding with bitfields
this testcase ICE's in invert_truthvalue, fold-const.c:3149: === Cut === class QSplitterPrivate; class QSplitter { void setResizeMode (); QSplitterPrivate *d_func (); }; struct QSplitterPrivate { bool compatMode:8; }; void QSplitter::setResizeMode () { QSplitterPrivate *const d = d_func (); if (!d->compatMode) ; } === Cut === bitfield-ice-2.ii: In member function 'void QSplitter::setResizeMode()': bitfield-ice-2.ii:16: internal compiler error: in invert_truthvalue, at fold-const.c:3149 Please submit a full bug report, with preprocessed source if appropriate. See http://gcc.gnu.org/bugs.html> for instructions. -- Summary: ICE in const folding with bitfields Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27505
[Bug c++/27506] New: [4.2 Regression] bitfield enum handling regression
the following testcase no longer compiles: === Cut === enum EBorderStyle { BNATIVE, BHIDDEN }; class BorderValue { public: EBorderStyle style:1; }; struct CollapsedBorderValue { EBorderStyle style () const { return border ? border->style : BNATIVE; } const BorderValue *border; }; === Cut === -- Summary: [4.2 Regression] bitfield enum handling regression Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: critical Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27506
[Bug c++/27471] [4.2 Regression] ICE within build_c_cast cp/typeck.c:5434
--- Comment #2 from mueller at gcc dot gnu dot org 2006-05-08 19:54 --- raising severity because it triggers frequently -- mueller at gcc dot gnu dot org changed: What|Removed |Added Severity|normal |major http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27471
[Bug c++/27505] [4.2 Regression] ICE in const folding with bitfields
--- Comment #2 from mueller at gcc dot gnu dot org 2006-05-08 19:55 --- triggering quite often, raising severity -- mueller at gcc dot gnu dot org changed: What|Removed |Added Severity|normal |critical http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27505
[Bug c++/27506] [4.2 Regression] bitfield enum handling regression
--- Comment #1 from mueller at gcc dot gnu dot org 2006-05-08 20:31 --- error message is: bitfield-error-1.cc:14: error: invalid conversion from 'int' to 'EBorderStyle' -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27506
[Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
--- Comment #10 from mueller at gcc dot gnu dot org 2006-05-16 08:37 --- ok, rerunning regtest -- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|pinskia at gcc dot gnu dot |mueller at gcc dot gnu dot |org |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
[Bug c++/24561] no static definition at -O0
--- Comment #13 from mueller at gcc dot gnu dot org 2006-05-26 18:39 --- It also causes bootstrap failures (see PR18058) -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||mueller at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24561
[Bug c++/13717] duplicated parameter name not caught ?
--- Comment #6 from mueller at gcc dot gnu dot org 2006-05-29 16:26 --- it might not be invalid, but its certainly worth a diagnostic IMHO -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13717
[Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
--- Comment #12 from mueller at gcc dot gnu dot org 2006-05-30 13:44 --- Subject: Bug 27273 Author: mueller Date: Tue May 30 13:43:55 2006 New Revision: 114238 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114238 Log: PR c/27273 * c-common.c (convert_and_check): only track TREE_CONSTANT_OVERFLOW for CONSTANT_CLASS_P expressions. * gcc.dg/overflow-warn-5.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/overflow-warn-5.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
[Bug c/27273] [4.2 regression] tree check fail for legal code when convert returns a constant from an expression that was not constant
--- Comment #13 from mueller at gcc dot gnu dot org 2006-05-30 13:44 --- Fixed. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27273
[Bug c/8268] no compile time array index checking
--- Comment #40 from mueller at gcc dot gnu dot org 2006-06-08 15:50 --- I've a patch, which is currently blocked by -fivopts bug -- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |mueller at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8268
[Bug c++/28659] [4.2 regression] ICE (segfault) while compiling kdelibs 4.0 snapshot
--- Comment #6 from mueller at gcc dot gnu dot org 2006-08-13 12:48 --- I'm currently testing this patch: --- cp/decl2.c (revision 116108) +++ cp/decl2.c (working copy) @@ -1541,7 +1541,7 @@ static tree min_vis_r (tree *tp, int *walk_subtrees, void *data) { int *vis_p = (int *)data; - if (! TYPE_P (*tp)) + if (! TYPE_P (*tp) || ! IS_AGGR_TYPE (*tp)) { *walk_subtrees = 0; } -- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |mueller at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2006-08-08 20:50:40 |2006-08-13 12:48:44 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28659
[Bug c++/28659] [4.2 regression] ICE (segfault) while compiling kdelibs 4.0 snapshot
--- Comment #7 from mueller at gcc dot gnu dot org 2006-08-18 17:55 --- struct oD.1993: type_0 type_5 type_6 BLK size constant invariant 0> unit size constant invariant 0> align 8 symtab 0 alias set -1 attributes local bindings <(nil)>> value readonly constant invariant static "default\000">>> no-binfo use_template=1 interface-unknown> the original type is: oD.1985:: type_0 type_5 type_6 BLK size unit size align 8 symtab 0 alias set -1 attributes local bindings <(nil)>> value readonly constant invariant static "default\000">>> no-binfo use_template=1 interface-unknown> QI size constant invariant 8> unit size constant invariant 1> align 8 symtab 0 alias set -1 method basetype > arg-types > unsigned SI size unit size align 32 symtab 0 alias set -1> chain >>> -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28659
[Bug c++/28659] [4.2 regression] ICE (segfault) while compiling kdelibs 4.0 snapshot
--- Comment #9 from mueller at gcc dot gnu dot org 2006-08-22 09:19 --- Thanks Jason! I'll regtest immediately. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28659
[Bug c++/26167] -Wconversion fails to detect signedness conversion from int to unsigned int in fuction call
--- Comment #11 from mueller at gcc dot gnu dot org 2006-09-18 12:11 --- yes please. Actually I created my own patch for bringing the C++ frontend on ear with the C frontend, but I didn't submit it because it produced bazillions of (legal) warnings in the code I usually compile, too many to be useful. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26167
[Bug c++/26785] "extra qualification" error gives line number of end of declaration
--- Comment #2 from mueller at gcc dot gnu dot org 2006-10-16 15:22 --- ehm, this is the same with any warning/error message? why would this case be special? -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||mueller at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26785
[Bug c++/7302] -Wnon-virtual-dtor should't complain of protected dtor
-- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |mueller at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Keywords||patch Last reconfirmed|2005-12-11 23:01:26 |2006-10-16 15:26:28 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7302
[Bug c++/18410] GCC does not warn about hidden methods
--- Comment #4 from mueller at gcc dot gnu dot org 2006-10-16 15:34 --- use -Woverloaded-virtual -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||mueller at gcc dot gnu dot ||org Status|NEW |RESOLVED Resolution||WORKSFORME http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18410
[Bug c++/24525] g++ fails to warn when converting UDT through double to int
-- mueller at gcc dot gnu dot org changed: What|Removed |Added Severity|trivial |minor http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24525
[Bug c++/26167] -Wconversion fails to detect signedness conversion from int to unsigned int in fuction call
--- Comment #14 from mueller at gcc dot gnu dot org 2006-10-16 15:37 --- *** Bug 26298 has been marked as a duplicate of this bug. *** -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||m dot becker at spider- ||software dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26167
[Bug c++/26298] -Wconversion fails to detect signedness change during widening conversion
--- Comment #6 from mueller at gcc dot gnu dot org 2006-10-16 15:37 --- *** This bug has been marked as a duplicate of 26167 *** -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26298
[Bug c++/29485] New: missing diagnostic when declared inline in class declaration
Hi, this testcase fails to produce a "return value missing" diagnostic: === Cut === class test { bool fii(test* other) { if (!other) return false; } }; === Cut === Interestingly, it works when declared outside the class itself, which makes me suspect that this is caused by some C++ parser oddity. -- Summary: missing diagnostic when declared inline in class declaration Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29485
[Bug c++/21678] Using inline disables warnings about missing return statements
--- Comment #5 from mueller at gcc dot gnu dot org 2006-10-17 09:34 --- take a look at the testcase in bugreport 29485 - there it should have at least instantiated the method -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21678
[Bug debug/30629] New: [Regression:4.3/4.2] -g causes undefined references
Consider this testcase: === Cut === static int hacky_auxmaps[2]; static signed int auxmap_used = 0; static int *auxmap = &hacky_auxmaps[0]; static void mc_pre_reg_read ( unsigned size) { vgPlain_message ("memcheck: auxmaps: %d auxmap entries in use", auxmap_used); } === Cut === compiling it with -O2 -g results in an undefined reference to "hacky_auxmaps". just compiling with -O2 or with -O0 fixes it. -- Summary: [Regression:4.3/4.2] -g causes undefined references Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org GCC host triplet: i686-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30629
[Bug middle-end/30636] [4.3 Regression] incorrect array bounds warning on multi-dimensional arrays
--- Comment #3 from mueller at gcc dot gnu dot org 2007-01-30 13:09 --- I'm not flagging this as diagnostic for now, because it is imho still a bug in ccp that could cause other side-effects (aliasing analysis?). if it is clear that the only problem this causes is the warning then I'll happily add a suppression for this case. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Keywords|diagnostic | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30636
[Bug c++/30601] [4.3 regression] -Wreturn-type warns about more than what the documentation says
--- Comment #13 from mueller at gcc dot gnu dot org 2007-01-30 16:20 --- Subject: Bug 30601 Author: mueller Date: Tue Jan 30 16:20:06 2007 New Revision: 121342 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121342 Log: 2007-01-30 Dirk Mueller <[EMAIL PROTECTED]> PR c++/30601 * doc/invoke.texi (-Wreturn-type): Update description to match new behavior. Modified: trunk/gcc/ChangeLog trunk/gcc/doc/invoke.texi -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30601
[Bug c/8268] no compile time array index checking
--- Comment #45 from mueller at gcc dot gnu dot org 2007-01-30 17:17 --- Subject: Bug 8268 Author: mueller Date: Tue Jan 30 17:17:39 2007 New Revision: 121346 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121346 Log: backport from mainline: 2007-01-21 Dirk Mueller <[EMAIL PROTECTED]> PR bootstrap/30511 * tree-vrp.c (check_array_bounds): do not warn about ADDR_EXPR's of ARRAY_REF's which are immediately used in binary expressions. 2007-01-19 Dirk Mueller <[EMAIL PROTECTED]> * config/i386.h (CONDITIONAL_REGISTER_USAGE): Store result of PIC_OFFSET_TABLE_REGNUM in temporary variable to avoid duplicate evaluation. 2007-01-18 Dirk Mueller <[EMAIL PROTECTED]> Richard Guenther <[EMAIL PROTECTED]> PR diagnostic/8268 * doc/invoke.texi (Warray-bounds): Document -Warray-bounds. * common.opt (Warray-bounds): Add new warning option. * c-opts.c (c_common_handle_option): Define -Warray-bounds if -Wall is given. * Makefile.in: make tree-vrp.o depend on toplev.h * tree-vrp.c (vrp_finalize): Call check_array_refs if * -Warray-bounds is enabled. (check_array_refs, check_array_bounds, check_array_ref): New. Added: branches/suse/gcc-4_2-branch/gcc/testsuite/g++.dg/warn/Warray-bounds-2.C - copied unchanged from r120898, trunk/gcc/testsuite/g++.dg/warn/Warray-bounds-2.C branches/suse/gcc-4_2-branch/gcc/testsuite/g++.dg/warn/Warray-bounds.C - copied unchanged from r120898, trunk/gcc/testsuite/g++.dg/warn/Warray-bounds.C branches/suse/gcc-4_2-branch/gcc/testsuite/gcc.dg/Warray-bounds-2.c - copied unchanged from r120898, trunk/gcc/testsuite/gcc.dg/Warray-bounds-2.c branches/suse/gcc-4_2-branch/gcc/testsuite/gcc.dg/Warray-bounds.c - copied unchanged from r120898, trunk/gcc/testsuite/gcc.dg/Warray-bounds.c Modified: branches/suse/gcc-4_2-branch/gcc/Makefile.in branches/suse/gcc-4_2-branch/gcc/c-opts.c branches/suse/gcc-4_2-branch/gcc/common.opt branches/suse/gcc-4_2-branch/gcc/config/i386/i386.h branches/suse/gcc-4_2-branch/gcc/doc/invoke.texi branches/suse/gcc-4_2-branch/gcc/tree-vrp.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8268
[Bug bootstrap/30511] False array bound check causes gcc failed to boostrap
--- Comment #9 from mueller at gcc dot gnu dot org 2007-01-30 17:18 --- Subject: Bug 30511 Author: mueller Date: Tue Jan 30 17:17:39 2007 New Revision: 121346 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121346 Log: backport from mainline: 2007-01-21 Dirk Mueller <[EMAIL PROTECTED]> PR bootstrap/30511 * tree-vrp.c (check_array_bounds): do not warn about ADDR_EXPR's of ARRAY_REF's which are immediately used in binary expressions. 2007-01-19 Dirk Mueller <[EMAIL PROTECTED]> * config/i386.h (CONDITIONAL_REGISTER_USAGE): Store result of PIC_OFFSET_TABLE_REGNUM in temporary variable to avoid duplicate evaluation. 2007-01-18 Dirk Mueller <[EMAIL PROTECTED]> Richard Guenther <[EMAIL PROTECTED]> PR diagnostic/8268 * doc/invoke.texi (Warray-bounds): Document -Warray-bounds. * common.opt (Warray-bounds): Add new warning option. * c-opts.c (c_common_handle_option): Define -Warray-bounds if -Wall is given. * Makefile.in: make tree-vrp.o depend on toplev.h * tree-vrp.c (vrp_finalize): Call check_array_refs if * -Warray-bounds is enabled. (check_array_refs, check_array_bounds, check_array_ref): New. Added: branches/suse/gcc-4_2-branch/gcc/testsuite/g++.dg/warn/Warray-bounds-2.C - copied unchanged from r120898, trunk/gcc/testsuite/g++.dg/warn/Warray-bounds-2.C branches/suse/gcc-4_2-branch/gcc/testsuite/g++.dg/warn/Warray-bounds.C - copied unchanged from r120898, trunk/gcc/testsuite/g++.dg/warn/Warray-bounds.C branches/suse/gcc-4_2-branch/gcc/testsuite/gcc.dg/Warray-bounds-2.c - copied unchanged from r120898, trunk/gcc/testsuite/gcc.dg/Warray-bounds-2.c branches/suse/gcc-4_2-branch/gcc/testsuite/gcc.dg/Warray-bounds.c - copied unchanged from r120898, trunk/gcc/testsuite/gcc.dg/Warray-bounds.c Modified: branches/suse/gcc-4_2-branch/gcc/Makefile.in branches/suse/gcc-4_2-branch/gcc/c-opts.c branches/suse/gcc-4_2-branch/gcc/common.opt branches/suse/gcc-4_2-branch/gcc/config/i386/i386.h branches/suse/gcc-4_2-branch/gcc/doc/invoke.texi branches/suse/gcc-4_2-branch/gcc/tree-vrp.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30511
[Bug middle-end/30636] [4.3 Regression] incorrect array bounds warning on multi-dimensional arrays
-- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |mueller at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30636
[Bug middle-end/30636] [4.3 Regression] incorrect array bounds warning on multi-dimensional arrays
--- Comment #8 from mueller at gcc dot gnu dot org 2007-02-01 13:27 --- removing diagnostic keyword again. This is latent wrong-code. -- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|mueller at gcc dot gnu dot |rguenth at gcc dot gnu dot |org |org Keywords|diagnostic | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30636
[Bug bootstrap/30510] [4.3 Regression] Gcc failed to bootstrap
--- Comment #21 from mueller at gcc dot gnu dot org 2007-02-05 12:43 --- Subject: Bug 30510 Author: mueller Date: Mon Feb 5 12:43:17 2007 New Revision: 121596 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121596 Log: 2007-02-05 Dirk Mueller <[EMAIL PROTECTED]> PR bootstrap/30510 * parser.c (cp_parser_class_specifier): Always initialize bases. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30510
[Bug bootstrap/30510] [4.3 Regression] Gcc failed to bootstrap
--- Comment #22 from mueller at gcc dot gnu dot org 2007-02-05 12:43 --- Fixed in 4.3. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30510
[Bug c/17946] wanted: warning for "a && MASK" when "a & MASK" was probably intended
--- Comment #12 from mueller at gcc dot gnu dot org 2007-02-19 10:21 --- I've submitted a patch -- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |mueller at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17946
[Bug c++/30860] Should warn about boolean constant false used in pointer context
--- Comment #1 from mueller at gcc dot gnu dot org 2007-02-19 16:43 --- manu, is this something already covered by your pending -Wconversion fixes? -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||manu at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30860
[Bug c++/30860] Should warn about boolean constant false used in pointer context
-- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-02-19 20:21:31 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30860
[Bug c++/30860] Should warn about boolean constant false used in pointer context
--- Comment #6 from mueller at gcc dot gnu dot org 2007-02-19 20:23 --- there is an implicit value conversion, boolean "false" to address "0". I think that is the definition of -Wconversion, no? anyway, I'll work on a patch. -- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |mueller at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30860
[Bug middle-end/31058] New: array overflow warning due to incorrect loop unrolling
building this testcase with -O2 -march=athlon -Wall -fprefetch-loop-arrays gives: warning: array subscript is above array bounds [...] which, according to VRP, seems to be valid. testcase is: === Cut === struct real_value { unsigned int cl:2; unsigned int decimal:1; unsigned long sig[5]; }; unsigned int uexp; static void clear_significand_below (struct real_value *r, unsigned int n) { int i, w = n / 32; for (i = 0; i < w; ++i) r->sig[i] = 0; } void do_fix_trunc (struct real_value *r) { if (uexp < 160) clear_significand_below (r, 160 - uexp); } === Cut === -- Summary: array overflow warning due to incorrect loop unrolling Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31058
[Bug middle-end/31058] array overflow warning due to incorrect loop unrolling
--- Comment #1 from mueller at gcc dot gnu dot org 2007-03-06 15:22 --- after prefetch-loop-arrays run, vrp2 looks like this: :; D.1885_87 = &r_4(D)->sig[i_13]; D.1886_88 = D.1885_87 + 160B; __builtin_prefetch (D.1886_88, 1); r_4(D)->sig[i_13] = 0; i_8 = i_13 + 1; i_26 = i_8; r_4(D)->sig[i_26] = 0; i_28 = i_26 + 1; i_30 = i_28; r_4(D)->sig[i_30] = 0; i_32 = i_30 + 1; i_34 = i_32; r_4(D)->sig[i_34] = 0; i_36 = i_34 + 1; i_38 = i_36; r_4(D)->sig[i_38] = 0; i_40 = i_38 + 1; i_42 = i_40; r_4(D)->sig[i_42] = 0; i_44 = i_42 + 1; i_46 = i_44; r_4(D)->sig[i_46] = 0; i_48 = i_46 + 1; i_50 = i_48; r_4(D)->sig[i_50] = 0; i_52 = i_50 + 1; i_54 = i_52; r_4(D)->sig[i_54] = 0; i_56 = i_54 + 1; i_58 = i_56; r_4(D)->sig[i_58] = 0; i_60 = i_58 + 1; i_62 = i_60; r_4(D)->sig[i_62] = 0; i_64 = i_62 + 1; i_66 = i_64; r_4(D)->sig[i_66] = 0; i_68 = i_66 + 1; i_70 = i_68; r_4(D)->sig[i_70] = 0; i_72 = i_70 + 1; i_74 = i_72; r_4(D)->sig[i_74] = 0; i_76 = i_74 + 1; i_78 = i_76; r_4(D)->sig[i_78] = 0; [...] and so on. since it definitely writes more than 5 ints, I don't see how it should *not* overflow the array. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31058
[Bug middle-end/31058] bogus array overflow warnings in unrolled loops
--- Comment #7 from mueller at gcc dot gnu dot org 2007-03-07 10:59 --- I don't think this is the same testcase. you will get any warning in this case, because the compiler cannot determine that it is supposed to be dead code. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Summary|bogus array overflow|bogus array overflow |warnings in unreachable code|warnings in unrolled loops http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31058
[Bug middle-end/31058] bogus array overflow warnings in unrolled loops
--- Comment #9 from mueller at gcc dot gnu dot org 2007-03-07 11:34 --- well, the unrolled body is generated code, it could set TREE_NO_WARNING (for example). or it could avoid unrolling if its not a flex array. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31058
[Bug middle-end/31058] overflow warnings should not be enabled with -Wall
-- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-03-07 21:55:36 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31058
[Bug middle-end/31058] overflow warnings should not be enabled with -Wall
--- Comment #18 from mueller at gcc dot gnu dot org 2007-03-07 22:03 --- IIRC there are some cases that are only caught in the 2nd vrp run. It is still a possibility if this bug cannot be fixed otherwise. However, I don't see the issue with this testcase. a) its not a flex array b) the unrolled loop produces out of bounds accesses c) hence, the unrolled version cannot ever be used d) it shouldn't be produced in the first place. we can turn this bug about a false positive warning into a code bloat regression by removing the warning (or disabling it from -Wall). That doesn't fix it though. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31058
[Bug middle-end/31058] overflow warnings should not be enabled with -Wall
--- Comment #23 from mueller at gcc dot gnu dot org 2007-03-08 21:32 --- Great, this patch makes a -fprefetch-loop-arrays bootstrap succeed. I think LSHIFT_EXPR should be handled similar. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31058
[Bug c/17946] wanted: warning for "a && MASK" when "a & MASK" was probably intended
--- Comment #13 from mueller at gcc dot gnu dot org 2007-03-09 16:16 --- Subject: Bug 17946 Author: mueller Date: Fri Mar 9 16:16:35 2007 New Revision: 122751 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122751 Log: 2007-03-09 Dirk Mueller <[EMAIL PROTECTED]> PR c++/17946 * doc/invoke.texi (-Wlogical-op): Document. * common.opt (-Wlogical-op): New. * c-common.h (warn_logical_operator): Declare. * c-common.c (warn_logical_operator): Define. * c-typeck.c (parser_build_binary_op): Call warn_logical_operator. * cp/call.c (build_new_op): Call warn_logical_operator. * testsuite/gcc.dg/Wlogical-op-1.c: New. * testsuite/g++.dg/warn/Wlogical-op-1.C: New. Added: trunk/gcc/testsuite/g++.dg/warn/Wlogical-op-1.C trunk/gcc/testsuite/gcc.dg/Wlogical-op-1.c Modified: trunk/gcc/ChangeLog trunk/gcc/c-common.c trunk/gcc/c-common.h trunk/gcc/c-typeck.c trunk/gcc/common.opt trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/doc/invoke.texi trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17946
[Bug c/17946] wanted: warning for "a && MASK" when "a & MASK" was probably intended
--- Comment #14 from mueller at gcc dot gnu dot org 2007-03-09 16:17 --- Fixed for 4.3. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17946
[Bug c/17946] wanted: warning for "a && MASK" when "a & MASK" was probably intended
--- Comment #17 from mueller at gcc dot gnu dot org 2007-03-10 17:26 --- Subject: Bug 17946 Author: mueller Date: Sat Mar 10 17:26:33 2007 New Revision: 122798 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122798 Log: 2007-03-10 Dirk Mueller <[EMAIL PROTECTED]> PR c++/17946 * gcc.dg/Wlogical-op-1.c: Remove duplicated part. * g++.dg/warn/Wlogical-op-1.C: Remove duplicated part. Modified: trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17946
[Bug c++/30860] Should warn about boolean constant false used in pointer context
--- Comment #10 from mueller at gcc dot gnu dot org 2007-03-14 23:17 --- Subject: Bug 30860 Author: mueller Date: Wed Mar 14 23:17:03 2007 New Revision: 122934 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122934 Log: 2007-03-15 Dirk Mueller <[EMAIL PROTECTED]> PR c++/30860 * call.c (convert_conversion_warnings): New.. (convert_like_real): .. factored out from here. (convert_conversion_warnings): Add warning about false being converted to NULL in argument passing. * g++.dg/warn/Wconversion2.C: New. Added: trunk/gcc/testsuite/g++.dg/warn/Wconversion2.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30860
[Bug c++/30860] Should warn about boolean constant false used in pointer context
--- Comment #11 from mueller at gcc dot gnu dot org 2007-03-14 23:20 --- Fixed for 4.3. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED Target Milestone|--- |4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30860
[Bug middle-end/30864] [4.3 Regression] ice for legal code with -O2
--- Comment #6 from mueller at gcc dot gnu dot org 2007-03-19 13:21 --- it seems to be caused by -r121780 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30864
[Bug middle-end/30864] [4.3 Regression] ice for legal code with -O2
--- Comment #7 from mueller at gcc dot gnu dot org 2007-03-20 12:48 --- testcase works after PR31146 fix *** This bug has been marked as a duplicate of 31146 *** -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30864
[Bug tree-optimization/31146] forwprop does not look through casts
--- Comment #8 from mueller at gcc dot gnu dot org 2007-03-20 12:48 --- *** Bug 30864 has been marked as a duplicate of this bug. *** -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||dcb314 at hotmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31146
[Bug tree-optimization/31227] [4.3 Regression] -Warray-bounds doesn't play together with loop optimizations
--- Comment #3 from mueller at gcc dot gnu dot org 2007-03-21 09:05 --- both are caused by our well known offender -fivopts. the problem why the existing workarounds don't work is because the adress is first converted to unsigned int before +/- modification is done. the traversal stops at the type conversion. I'm currently working on fixing that. -- mueller at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |mueller at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31227
[Bug tree-optimization/31227] [4.3 Regression] -Warray-bounds doesn't play together with loop optimizations
--- Comment #4 from mueller at gcc dot gnu dot org 2007-03-21 14:16 --- Created an attachment (id=13242) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13242&action=view) patch this is the patch I'm currently testing. would be nice if you could confirm that this is also fixing your obj-c++ bootstrap problem (which I cannot reproduce). Thanks. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31227
[Bug tree-optimization/31227] [4.3 Regression] -Warray-bounds doesn't play together with loop optimizations
-- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|WAITING http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31227
[Bug tree-optimization/31227] [4.3 Regression] -Warray-bounds doesn't play together with loop optimizations
--- Comment #6 from mueller at gcc dot gnu dot org 2007-04-18 21:09 --- Subject: Bug 31227 Author: mueller Date: Wed Apr 18 21:09:21 2007 New Revision: 123958 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123958 Log: 2007-04-18 Dirk Mueller <[EMAIL PROTECTED]> PR diagnostic/31227 * tree-vrp.c (search_for_addr_array): New. (check_array_bounds): Suppress warning about address taken of array refs if its not de-referenced. * gcc.dg/Warray-bounds-3.c: New. Added: trunk/gcc/testsuite/gcc.dg/Warray-bounds-3.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vrp.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31227
[Bug tree-optimization/31227] [4.3 Regression] -Warray-bounds doesn't play together with loop optimizations
--- Comment #7 from mueller at gcc dot gnu dot org 2007-04-18 21:10 --- Fixed in 4.3. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31227
[Bug c++/32756] [4.3 Regression] wrong ambiguous overload error?
--- Comment #4 from mueller at gcc dot gnu dot org 2007-08-20 11:13 --- ping.. any results? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32756
[Bug c++/32756] [4.3 Regression] wrong ambiguous overload error?
--- Comment #6 from mueller at gcc dot gnu dot org 2007-08-20 12:43 --- I`d be happy to help with testing :) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32756
[Bug c++/33399] New: [4.2 regression] -fvisibility=hidden not working after including STL headers
Hi, g++ 4.2.1 doesn't seem to apply hidden visibility to classes after including e.g. . the following testcase was reduced: === Cut === namespace std __attribute__ ((__visibility__ ("default"))) { template < typename A > class C; template < typename A > int foo (C < A > *); template < typename A > class C { public: friend int foo<>(C *); }; extern template class C < char >; } struct TestClass { void hidden(); }; void TestClass::hidden() {} === cut === g++ -O1 -fvisibility=hidden -fvisibility-inlines-hidden -fPIC testcase.cc -c -o nostl.o g++ -shared -o libnostl.so nostl.o nm -CD libnostl.so | grep TestClass gives 048c T TestClass::hidden() the symbol is properly hidden if I put the namespace std into default visibility or otherwise try to reduce the code further. -- Summary: [4.2 regression] -fvisibility=hidden not working after including STL headers Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org GCC host triplet: i686-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33399
[Bug c++/32470] fvisibility=hidden without effect in some cases
--- Comment #4 from mueller at gcc dot gnu dot org 2007-09-11 22:37 --- I can confirm it as well -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-09-11 22:37:55 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32470
[Bug c++/33399] [4.2 regression] -fvisibility=hidden not working after including STL headers
--- Comment #2 from mueller at gcc dot gnu dot org 2007-09-11 22:39 --- *** This bug has been marked as a duplicate of 32470 *** -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33399
[Bug c++/32470] [4.2 regression] fvisibility=hidden without effect in some cases
--- Comment #5 from mueller at gcc dot gnu dot org 2007-09-11 22:39 --- *** Bug 33399 has been marked as a duplicate of this bug. *** -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||mueller at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32470
[Bug middle-end/36902] Array bound warning with dead code after optimization
--- Comment #22 from mueller at gcc dot gnu dot org 2008-08-25 07:59 --- there is currently no good way to detect if a block is dead during the VRP pass, as the VRP information is used for *determining* wether or not a block is dead. Is there a general warning-queuing implementation that I could make use of or is there some other warning that does that already? Iirc the "is used/ might be used uninitialized" type of warnings do not use something like that. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36902
[Bug target/35135] New: [4.3 regression] unable to find a register to spill in class �GENERAL_REGS�
gcc -v -O2 -c test.c === Cut === extension__ typedef unsigned long long int uint64_t; typedef unsigned target_ulong; register target_ulong T0 asm ("ebx"); register target_ulong T1 asm ("esi"); register target_ulong T2 asm ("edi"); typedef struct CPUX86State { uint64_t xmm_regs[8]; } CPUX86State; save_raw_fp_state (CPUX86State * env) { int i; char *addr; for (i = 0; i < 8; i++) env->xmm_regs[i] = *(uint64_t *) (addr); } === Cut === GNU C (SUSE Linux) version 4.3.0 20080131 (experimental) [trunk revision 131976] (i586-suse-linux) compiled by GNU C version 4.3.0 20080131 (experimental) [trunk revision 131976], GMP version 4.2.2, MPFR version 2.3.1. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 86307befc2a0b2e7a5d9beb62be4b74e test.c: In function Âsave_raw_fp_stateÂ: test.c:18: error: unable to find a register to spill in class ÂGENERAL_REGSÂ test.c:18: error: this is the insn: (insn:HI 14 13 15 3 test.c:17 (set (mem/s:DI (plus:SI (mult:SI (reg/v:SI 64 [ i ]) (const_int 8 [0x8])) (reg/v/f:SI 66 [ env ])) [2 .xmm_regs S8 A8]) (reg:DI 67)) 63 {*movdi_2} (expr_list:REG_DEAD (reg:DI 67) (nil))) test.c:18: confused by earlier errors, bailing out -- Summary: [4.3 regression] unable to find a register to spill in class ÂGENERAL_REGSÂ Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org GCC host triplet: i686-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35135
[Bug target/35135] unable to find a register to spill in class �GENERAL_REGS� with global registers
--- Comment #4 from mueller at gcc dot gnu dot org 2008-02-12 17:18 --- new testcase: -O2 -fno-gcse -fomit-frame-pointer === Cut === __extension__ typedef unsigned long long int uint64_t; typedef unsigned int target_ulong; register struct CPUX86State *env asm ("ebp"); register target_ulong T0 asm ("ebx"); register target_ulong T1 asm ("esi"); register target_ulong T2 asm ("edi"); typedef union { uint64_t _q[2]; } XMMReg; typedef struct CPUX86State { XMMReg xmm_regs[8]; } CPUX86State; save_raw_fp_state (CPUX86State * env, char * ptr) { int i, fpus, fptag, nb_xmm_regs; char *addr; nb_xmm_regs = 8 << 0; addr = ptr + 0xa0; for (i = 0; i < nb_xmm_regs; i++) { env->xmm_regs[i]._q[0] = *(uint64_t *) (addr); addr += 16; } } === Cut === -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35135
[Bug target/35135] unable to find a register to spill in class �GENERAL_REGS� with global registers
--- Comment #3 from mueller at gcc dot gnu dot org 2008-02-12 16:31 --- the original code uses -fomit-frame-pointer -fno-gcse -O2. I can verify that -O3 fixes the issue. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35135
[Bug c++/31775] static object mangling conflicts with extern object
--- Comment #7 from mueller at gcc dot gnu dot org 2008-02-29 13:57 --- how about extern "C" void abort(); extern "C" { static int i; } int *p = &i; int main() { int i; { extern int i; i = 1; *p = 2; if (i == 2) abort (); } return 0; } in this case, the "i" name should not be mangled, right? -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC| |mueller at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31775
[Bug rtl-optimization/31806] New: miscompilation with -fschedule-insns2 -fthreadsafe-statics and static variables
Hi, the testcase below aborts with gcc 4.1.3 compiled with: g++ -O2 -fno-threadsafe-statics === Cut === extern "C" void abort(void); struct A { void *d; }; static const A& staticA() { static A s_static; return s_static; } void assert_failed() { abort(); } A testMethod() { static const A& s = staticA( ); if (&s == 0) assert_failed(); return s; } int main() { testMethod(); return 0; } // g++ -O2 -fno-inline -fno-threadsafe-statics -o kglobaltest kglobaltest.cpp === Cut === The testcase was extracted from a KDE miscompilation. -fno-schedule-insns2 seems to work around it. the bug is visible in assembler: · call· _Z7staticAv·# · movl· _ZZ10testMethodvE1s, %ebx· # s, s.1 · movb· $1, _ZGVZ10testMethodvE1s· #, · testl· %ebx, %ebx· # s.1 · movl· %eax, _ZZ10testMethodvE1s· # tmp61, s the movl %eax,_ZZ10testMethodvE1s is moved below the movl· _ZZ10testMethodvE1s, %ebx, which causes the bug. -- Summary: miscompilation with -fschedule-insns2 -fthreadsafe- statics and static variables Product: gcc Version: 4.1.3 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: rtl-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org GCC host triplet: i686-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806
[Bug c/32135] New: bogus array-ref fold triggering array overflow warning
Hi, -O2 Warray-bounds: === Cut === struct PhaseEntryType { char raw_field[50 + 1]; }; int ParsePhase (char in_cols[15][250], struct PhaseEntryType *P) { __builtin_strncpy (P->raw_field, in_cols[2], 50); } ~ === Cut === triggered by __builtin_strncpy ((char *) &P->raw_field, (const char *) (char *) in_cols + 500B, 50); being gimplified to: D.1970 = &(*in_cols)[500]; D.1971 = &P->raw_field[0]; __builtin_strncpy (D.1971, D.1970, 50) -- Summary: bogus array-ref fold triggering array overflow warning Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org GCC host triplet: i686-suse-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32135
[Bug c++/31809] [4.1/4.2/4.3 Regression] sometimes TREE_READONLY is still set for non read only variables causing wrong code
--- Comment #5 from mueller at gcc dot gnu dot org 2007-05-30 22:46 --- is it okay that was_readonly will eventually turn on TREE_READONLY() afterwards? -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||mueller at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31809
[Bug c++/31809] [4.1/4.2/4.3 Regression] sometimes TREE_READONLY is still set for non read only variables causing wrong code
--- Comment #7 from mueller at gcc dot gnu dot org 2007-05-31 09:06 --- PR 31806 is not fixed by this, and it contains a reference type. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31809
[Bug c++/31806] [4.0/4.1/4.2 Regression] miscompilation with -fschedule-insns2 -fno-threadsafe-statics
--- Comment #8 from mueller at gcc dot gnu dot org 2007-06-06 15:02 --- testcase works with gcc 3.4 and gcc 3.3 -- mueller at gcc dot gnu dot org changed: What|Removed |Added Known to fail|4.1.3 |4.1.3 4.0.4 Known to work|4.3.0 4.2.0 | Summary|miscompilation with - |[4.0/4.1/4.2 Regression] |fschedule-insns2 -fno- |miscompilation with - |threadsafe-statics |fschedule-insns2 -fno- ||threadsafe-statics http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806
[Bug c++/31806] [4.1/4.2 Regression] miscompilation with -fschedule-insns2 -fno-threadsafe-statics
--- Comment #9 from mueller at gcc dot gnu dot org 2007-06-08 21:48 --- Subject: Bug 31806 Author: mueller Date: Fri Jun 8 21:48:34 2007 New Revision: 125580 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125580 Log: 2007-06-08 Dirk Mueller <[EMAIL PROTECTED]> PR c++/31809 PR c++/31806 Backport from mainline: 2007-05-31 Jakub Jelinek <[EMAIL PROTECTED]> * decl.c (cp_finish_decl): Also clear was_readonly if a static var needs runtime initialization. 2007-05-30 Jakub Jelinek <[EMAIL PROTECTED]> * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC variables that need runtime initialization. PR c++/31809 Backport from mainline: 2007-05-30 Jakub Jelinek <[EMAIL PROTECTED]> * g++.dg/opt/static5.C: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/opt/static5.C - copied unchanged from r125201, trunk/gcc/testsuite/g++.dg/opt/static5.C Modified: branches/gcc-4_2-branch/gcc/cp/ChangeLog branches/gcc-4_2-branch/gcc/cp/decl.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806
[Bug c++/31809] [4.1/4.2 Regression] sometimes TREE_READONLY is still set for non read only variables causing wrong code
--- Comment #10 from mueller at gcc dot gnu dot org 2007-06-08 21:48 --- Subject: Bug 31809 Author: mueller Date: Fri Jun 8 21:48:34 2007 New Revision: 125580 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125580 Log: 2007-06-08 Dirk Mueller <[EMAIL PROTECTED]> PR c++/31809 PR c++/31806 Backport from mainline: 2007-05-31 Jakub Jelinek <[EMAIL PROTECTED]> * decl.c (cp_finish_decl): Also clear was_readonly if a static var needs runtime initialization. 2007-05-30 Jakub Jelinek <[EMAIL PROTECTED]> * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC variables that need runtime initialization. PR c++/31809 Backport from mainline: 2007-05-30 Jakub Jelinek <[EMAIL PROTECTED]> * g++.dg/opt/static5.C: New test. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/opt/static5.C - copied unchanged from r125201, trunk/gcc/testsuite/g++.dg/opt/static5.C Modified: branches/gcc-4_2-branch/gcc/cp/ChangeLog branches/gcc-4_2-branch/gcc/cp/decl.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31809
[Bug c++/31806] [4.1 Regression] miscompilation with -fschedule-insns2 -fno-threadsafe-statics
--- Comment #10 from mueller at gcc dot gnu dot org 2007-06-14 23:12 --- Subject: Bug 31806 Author: mueller Date: Thu Jun 14 23:12:25 2007 New Revision: 125726 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125726 Log: 2007-06-14 Dirk Mueller <[EMAIL PROTECTED]> PR c++/31806 * g++.dg/opt/static6.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/opt/static6.C Modified: trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806
[Bug c++/31806] [4.1 Regression] miscompilation with -fschedule-insns2 -fno-threadsafe-statics
--- Comment #11 from mueller at gcc dot gnu dot org 2007-06-20 16:27 --- Subject: Bug 31806 Author: mueller Date: Wed Jun 20 16:27:23 2007 New Revision: 125887 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125887 Log: 2007-06-20 Dirk Mueller <[EMAIL PROTECTED]> PR c++/31809 PR c++/31806 Backport from mainline: 2007-05-31 Jakub Jelinek <[EMAIL PROTECTED]> * decl.c (cp_finish_decl): Also clear was_readonly if a static var needs runtime initialization. 2007-05-30 Jakub Jelinek <[EMAIL PROTECTED]> * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC variables that need runtime initialization. * g++.dg/opt/static5.C: New testcase * g++.dg/opt/static6.C: Likewise Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/opt/static5.C branches/gcc-4_1-branch/gcc/testsuite/g++.dg/opt/static6.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/decl.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806
[Bug c++/31809] [4.1 Regression] sometimes TREE_READONLY is still set for non read only variables causing wrong code
--- Comment #11 from mueller at gcc dot gnu dot org 2007-06-20 16:27 --- Subject: Bug 31809 Author: mueller Date: Wed Jun 20 16:27:23 2007 New Revision: 125887 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125887 Log: 2007-06-20 Dirk Mueller <[EMAIL PROTECTED]> PR c++/31809 PR c++/31806 Backport from mainline: 2007-05-31 Jakub Jelinek <[EMAIL PROTECTED]> * decl.c (cp_finish_decl): Also clear was_readonly if a static var needs runtime initialization. 2007-05-30 Jakub Jelinek <[EMAIL PROTECTED]> * decl.c (cp_finish_decl): Clear TREE_READONLY flag on TREE_STATIC variables that need runtime initialization. * g++.dg/opt/static5.C: New testcase * g++.dg/opt/static6.C: Likewise Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/opt/static5.C branches/gcc-4_1-branch/gcc/testsuite/g++.dg/opt/static6.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/decl.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31809
[Bug c++/31809] [4.1 Regression] sometimes TREE_READONLY is still set for non read only variables causing wrong code
--- Comment #12 from mueller at gcc dot gnu dot org 2007-06-20 16:28 --- Fixed. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31809
[Bug c++/31806] [4.1 Regression] miscompilation with -fschedule-insns2 -fno-threadsafe-statics
--- Comment #12 from mueller at gcc dot gnu dot org 2007-06-20 16:28 --- Fixed -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806
[Bug middle-end/32546] 'warning: array subscript is above/below array bounds' on delete[]
--- Comment #2 from mueller at gcc dot gnu dot org 2007-07-13 11:10 --- unfortunately setting TREE_NO_WARNING on the synthesized delete[] parameters does not help because it is lost during middle end folding -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32546
[Bug middle-end/32546] 'warning: array subscript is above/below array bounds' on delete[]
--- Comment #1 from mueller at gcc dot gnu dot org 2007-07-13 11:05 --- this is yet another case of the middle end folding memory arithmetics back into an array ref that is out of bounds: operator delete [] ((void *) A + 0xfffc); (from orig dump) later it is: D.2607_30 = &(*D.2517_7)[-4]; operator delete [] (D.2607_30); which will then trigger this warning (because -4 is clearly out of bounds). -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-07-13 11:05:25 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32546
[Bug c++/32756] New: wrong ambiguous overload error?
Hi, this might be invalid, needs verification. starting with gcc 4.3, the following testcase is rejected: === Cut === class QString; struct QByteArray { QByteArray (); bool operator!= (const QString & s2) const; }; bool operator!= (const QByteArray & a1, const QByteArray & a2); struct QString { QString (); QString (const QByteArray & a); }; QByteArray abbreviation (); void fromString () { QByteArray zoneAbbrev; if (abbreviation () != zoneAbbrev) { } } === Cut === ambiguity.cc:23: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: ambiguity.cc:9: note: candidate 1: bool operator!=(const QByteArray&, const QByteArray&) ambiguity.cc:6: note: candidate 2: bool QByteArray::operator!=(const QString&) const -- Summary: wrong ambiguous overload error? Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32756
[Bug c++/32756] [4.3 Regression] wrong ambiguous overload error?
--- Comment #1 from mueller at gcc dot gnu dot org 2007-07-14 07:33 --- this was introduced by the following patch: 2007-05-30 Russell Yanofsky <[EMAIL PROTECTED]> Douglas Gregor <[EMAIL PROTECTED]> Pedro Lamarao <[EMAIL PROTECTED]> Howard Hinnant <[EMAIL PROTECTED]> PR c++/7412 PR c++/29939 -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||doug dot gregor at gmail dot ||com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32756
[Bug c++/32756] [4.3 Regression] wrong ambiguous overload error?
--- Comment #2 from mueller at gcc dot gnu dot org 2007-07-14 10:00 --- Created an attachment (id=13914) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13914&action=view) patch the following patch moves the change of ranking described in the working draft under a "dialect" check, which hot-fixes this bug -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32756
[Bug c++/34111] New: new oveload resolution error
this used to work a few days ago still: -- Summary: new oveload resolution error Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34111
[Bug c++/34111] new oveload resolution error
--- Comment #1 from mueller at gcc dot gnu dot org 2007-11-15 16:55 --- Created an attachment (id=14559) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14559&action=view) the preprocessed source .ii file -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34111
[Bug bootstrap/34110] gcc fails to build on i686
--- Comment #1 from mueller at gcc dot gnu dot org 2007-11-15 18:21 --- temp_stack.reg[i_90] is the access, compare_for_stack_reg is the function, and i_90 has the VRP determined range [-1, 2147483646]. it shouldn't warn for that. I'll work on a patch. -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-11-15 18:21:40 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34110
[Bug c++/34111] new overload resolution error
--- Comment #2 from mueller at gcc dot gnu dot org 2007-11-15 23:17 --- reduced testcase: class QChar { }; struct QString { QString(QChar); }; struct QPainter { void drawText (int x, int y, const QString &); }; class KHEChar:public QChar { public:KHEChar (QChar C); }; void drawByte (QPainter * P, char, KHEChar B) { P->drawText (0, 0, B); } -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2007-11-15 23:17:52 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34111
[Bug bootstrap/34110] gcc fails to build on i686
--- Comment #2 from mueller at gcc dot gnu dot org 2007-11-16 11:37 --- workaround: --- reg-stack.c (revision 130198) +++ reg-stack.c (working copy) @@ -925,7 +925,7 @@ swap_to_top (rtx insn, stack regstack, r /* Place operand 1 at the top of stack. */ regno = get_hard_regnum (&temp_stack, src1); gcc_assert (regno >= 0); - if (regno != FIRST_STACK_REG) + if (regno >= 0 && regno != FIRST_STACK_REG) { k = temp_stack.top - (regno - FIRST_STACK_REG); j = temp_stack.top; @@ -938,7 +938,7 @@ swap_to_top (rtx insn, stack regstack, r /* Place operand 2 next on the stack. */ regno = get_hard_regnum (&temp_stack, src2); gcc_assert (regno >= 0); - if (regno != FIRST_STACK_REG + 1) + if (regno >= 0 && regno != FIRST_STACK_REG + 1) { k = temp_stack.top - (regno - FIRST_STACK_REG); j = temp_stack.top - 1; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34110
[Bug middle-end/34197] array overflow warning without line number
--- Comment #4 from mueller at gcc dot gnu dot org 2007-11-22 22:34 --- thanks for the analysis. I would go for a slightly more verbose version of the same patch: --- gcc/tree-vrp.c (revision 130297) +++ gcc/tree-vrp.c (working copy) @@ -4339,7 +4339,7 @@ check_array_ref (tree ref, location_t* l low_sub = up_sub = TREE_OPERAND (ref, 1); - if (!up_bound || !locus || TREE_NO_WARNING (ref) + if (!up_bound || TREE_NO_WARNING (ref) || TREE_CODE (up_bound) != INTEGER_CST /* Can not check flexible arrays. */ || (TYPE_SIZE (TREE_TYPE (ref)) == NULL_TREE @@ -4441,6 +4441,11 @@ check_array_bounds (tree *tp, int *walk_ tree stmt = (tree)data; location_t *location = EXPR_LOCUS (stmt); + if (!EXPR_HAS_LOCATION (stmt)) { + *walk_subtree = FALSE; + return NULL_TREE; + } + *walk_subtree = TRUE; if (TREE_CODE (t) == ARRAY_REF) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34197
[Bug middle-end/32546] [4.3 Regression] 'warning: array subscript is above/below array bounds' on delete[]
--- Comment #6 from mueller at gcc dot gnu dot org 2007-11-22 22:40 --- *** This bug has been marked as a duplicate of 34197 *** -- mueller at gcc dot gnu dot org changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32546
[Bug middle-end/34197] array overflow warning without line number
--- Comment #5 from mueller at gcc dot gnu dot org 2007-11-22 22:40 --- *** Bug 32546 has been marked as a duplicate of this bug. *** -- mueller at gcc dot gnu dot org changed: What|Removed |Added CC||gcc at abeckmann dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34197