public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression
@ 2007-07-27 9:04 scovich at gmail dot com
2007-07-28 0:46 ` [Bug tree-optimization/32912] [4.3 Regression] ICE with vector code pinskia at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: scovich at gmail dot com @ 2007-07-27 9:04 UTC (permalink / raw)
To: gcc-bugs
Compiling the test case below gives the following ICE:
> bug.C: In function 'void bar()':
> bug.C:30: internal compiler error: in build_int_cst_wide, at tree.c:890
> Please submit a full bug report,
I think this might be related to bug 20103, except that gcc-4.1 handles the
test case just fine. The test case also compiles in 4.3 with -O{0,1,s} instead
of -O{2,3}. -ftree-pre is the culprit flag -- removing it from -O2 or adding it
to -O1 toggles the bug.
// g++-4.3-20070716 -msse3 -O2 bug.C
#include <emmintrin.h>
// Must be a vector, not a scalar
#if 0
typedef long v2d;
#else
typedef __m128i v2d;
#endif
v2d rval();
v2d g;
struct A { // Must have 2+ members
v2d a;
v2d b;
};
struct B { // Need a struct containing an A
A a;
};
struct C {
operator A() {
v2d l;
A a;
// Must compute (a ^ ~b). Neither (a ^ b) nor (a + ~b) breaks.
a.a ^= ~a.b; // globals, locals, and rvals don't break
a.a ^= ~(v2d) {0,0}; // members and compound literals do
return a;
}
};
void foo(B);
void bar() {
foo((B){C()});
}
--
Summary: [Regression] ICE with C99 compound literal expression
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: scovich at gmail dot com
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
@ 2007-07-28 0:46 ` pinskia at gcc dot gnu dot org
2007-07-28 1:15 ` [Bug middle-end/32912] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-28 0:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2007-07-28 00:46 -------
This worked in 4.3.0 20070629. Also I doubt it is related to C99 compound
literal expressions, just for vectors you need to use them
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Component|c++ |tree-optimization
Summary|[Regression] ICE with C99 |[4.3 Regression] ICE with
|compound literal expression |vector code
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
2007-07-28 0:46 ` [Bug tree-optimization/32912] [4.3 Regression] ICE with vector code pinskia at gcc dot gnu dot org
@ 2007-07-28 1:15 ` pinskia at gcc dot gnu dot org
2007-08-10 0:52 ` mmitchel at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-28 1:15 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-07-28 01:15 -------
fold-const.c is causing it at:
10277 /* ~X ^ X is -1. */
The issue is that we don't fold ~vector_cst at all.
Anyways here is a reduced testcase:
typedef int __m128i __attribute__ ((__vector_size__ (16) ));
typedef __m128i v2d;
v2d rval();
v2d g;
struct A {
v2d a;
v2d b;
};
struct B {
A a;
};
void foo(B);
void bar() {
v2d l;
A a={};
a.a ^= ~a.b;
a.a ^= ~(v2d) {0,0};
B c = {a};
foo(c);
}
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Component|tree-optimization |middle-end
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-07-28 01:15:25
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
2007-07-28 0:46 ` [Bug tree-optimization/32912] [4.3 Regression] ICE with vector code pinskia at gcc dot gnu dot org
2007-07-28 1:15 ` [Bug middle-end/32912] " pinskia at gcc dot gnu dot org
@ 2007-08-10 0:52 ` mmitchel at gcc dot gnu dot org
2007-08-20 13:08 ` jakub at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-08-10 0:52 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
` (2 preceding siblings ...)
2007-08-10 0:52 ` mmitchel at gcc dot gnu dot org
@ 2007-08-20 13:08 ` jakub at gcc dot gnu dot org
2007-08-21 9:22 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-08-20 13:08 UTC (permalink / raw)
To: gcc-bugs
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2007-
| |08/msg01266.html
Status|NEW |ASSIGNED
Last reconfirmed|2007-07-28 01:15:25 |2007-08-20 13:08:00
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
` (3 preceding siblings ...)
2007-08-20 13:08 ` jakub at gcc dot gnu dot org
@ 2007-08-21 9:22 ` jakub at gcc dot gnu dot org
2007-08-24 17:16 ` jakub at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-08-21 9:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jakub at gcc dot gnu dot org 2007-08-21 09:22 -------
Subject: Bug 32912
Author: jakub
Date: Tue Aug 21 09:22:14 2007
New Revision: 127661
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127661
Log:
PR middle-end/32912
* fold-const.c (fold_unary): Optimize BIT_NOT_EXPR of VECTOR_CST.
(fold_binary): Handle vectors in X | ~X and X ^ ~X optimizations.
* gcc.dg/pr32912-1.c: New test.
* gcc.dg/pr32912-2.c: New test.
* gcc.dg/pr32912-3.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/pr32912-1.c
trunk/gcc/testsuite/gcc.dg/pr32912-2.c
trunk/gcc/testsuite/gcc.dg/pr32912-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
` (4 preceding siblings ...)
2007-08-21 9:22 ` jakub at gcc dot gnu dot org
@ 2007-08-24 17:16 ` jakub at gcc dot gnu dot org
2007-08-24 17:22 ` jakub at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-08-24 17:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2007-08-24 17:16 -------
Subject: Bug 32912
Author: jakub
Date: Fri Aug 24 17:15:51 2007
New Revision: 127779
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127779
Log:
PR middle-end/32912
* fold-const.c (fold_binary): Only optimize X | ~X and X ^ ~X for
integral types.
* gcc.dg/pr32912-1.c: New test.
* gcc.dg/pr32912-2.c: New test.
Added:
branches/gcc-4_2-branch/gcc/testsuite/gcc.dg/pr32912-1.c
branches/gcc-4_2-branch/gcc/testsuite/gcc.dg/pr32912-2.c
Modified:
branches/gcc-4_2-branch/gcc/fold-const.c
branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
` (5 preceding siblings ...)
2007-08-24 17:16 ` jakub at gcc dot gnu dot org
@ 2007-08-24 17:22 ` jakub at gcc dot gnu dot org
2007-08-24 17:24 ` jakub at gcc dot gnu dot org
2007-08-24 17:29 ` jakub at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-08-24 17:22 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jakub at gcc dot gnu dot org 2007-08-24 17:22 -------
Subject: Bug 32912
Author: jakub
Date: Fri Aug 24 17:21:42 2007
New Revision: 127781
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127781
Log:
PR middle-end/32912
* fold-const.c (fold_binary): Only optimize X | ~X and X ^ ~X for
integral types.
* gcc.dg/pr32912-1.c: New test.
* gcc.dg/pr32912-2.c: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/crash37.C
Modified:
branches/gcc-4_1-branch/gcc/cp/ChangeLog
branches/gcc-4_1-branch/gcc/cp/error.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
` (6 preceding siblings ...)
2007-08-24 17:22 ` jakub at gcc dot gnu dot org
@ 2007-08-24 17:24 ` jakub at gcc dot gnu dot org
2007-08-24 17:29 ` jakub at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-08-24 17:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2007-08-24 17:24 -------
Subject: Bug 32912
Author: jakub
Date: Fri Aug 24 17:23:43 2007
New Revision: 127783
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127783
Log:
PR middle-end/32912
* fold-const.c (fold_binary): Only optimize X | ~X and X ^ ~X for
integral types.
* gcc.dg/pr32912-1.c: New test.
* gcc.dg/pr32912-2.c: New test.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/pr32912-1.c
branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/pr32912-2.c
Modified:
branches/gcc-4_1-branch/gcc/ChangeLog
branches/gcc-4_1-branch/gcc/fold-const.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug middle-end/32912] [4.3 Regression] ICE with vector code
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
` (7 preceding siblings ...)
2007-08-24 17:24 ` jakub at gcc dot gnu dot org
@ 2007-08-24 17:29 ` jakub at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-08-24 17:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jakub at gcc dot gnu dot org 2007-08-24 17:29 -------
Fixed.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32912
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-08-24 17:29 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-27 9:04 [Bug c++/32912] New: [Regression] ICE with C99 compound literal expression scovich at gmail dot com
2007-07-28 0:46 ` [Bug tree-optimization/32912] [4.3 Regression] ICE with vector code pinskia at gcc dot gnu dot org
2007-07-28 1:15 ` [Bug middle-end/32912] " pinskia at gcc dot gnu dot org
2007-08-10 0:52 ` mmitchel at gcc dot gnu dot org
2007-08-20 13:08 ` jakub at gcc dot gnu dot org
2007-08-21 9:22 ` jakub at gcc dot gnu dot org
2007-08-24 17:16 ` jakub at gcc dot gnu dot org
2007-08-24 17:22 ` jakub at gcc dot gnu dot org
2007-08-24 17:24 ` jakub at gcc dot gnu dot org
2007-08-24 17:29 ` jakub at gcc dot gnu dot 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).