* [Bug middle-end/16809] [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
2004-07-28 21:33 [Bug middle-end/16809] New: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers bangerth at dealii dot org
@ 2004-07-28 21:33 ` bangerth at dealii dot org
2004-07-28 21:43 ` pinskia at gcc dot gnu dot org
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-07-28 21:33 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |3.5.0
Version|3.4.1 |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16809
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/16809] [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
2004-07-28 21:33 [Bug middle-end/16809] New: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers bangerth at dealii dot org
2004-07-28 21:33 ` [Bug middle-end/16809] " bangerth at dealii dot org
@ 2004-07-28 21:43 ` pinskia at gcc dot gnu dot org
2004-07-28 21:51 ` jsm at polyomino dot org dot uk
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-28 21:43 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-07-28 21:43 -------
ICE came about on the mainline
: Search converges between 2004-05-11-trunk (#454) and 2004-05-14-trunk (#455).
We started accepting this:
: Search converges between 2004-04-20-trunk (#449) and 2004-05-01-trunk (#450).
Before we errored:
input.cc: In function `int main()':
input.cc:3: error: initializer for scalar variable requires one element
So this is a regression no matter what, either we are ICEing when we should not be or we are accepting
invalid code when we should not be.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |accepts-invalid
Last reconfirmed|0000-00-00 00:00:00 |2004-07-28 21:43:32
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16809
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/16809] [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
2004-07-28 21:33 [Bug middle-end/16809] New: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers bangerth at dealii dot org
2004-07-28 21:33 ` [Bug middle-end/16809] " bangerth at dealii dot org
2004-07-28 21:43 ` pinskia at gcc dot gnu dot org
@ 2004-07-28 21:51 ` jsm at polyomino dot org dot uk
2004-07-28 21:52 ` bangerth at ices dot utexas dot edu
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: jsm at polyomino dot org dot uk @ 2004-07-28 21:51 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jsm at polyomino dot org dot uk 2004-07-28 21:51 -------
Subject: Re: New: [3.5 regression] ICE in gimplify_expr
with initializer of arrays and pointers
On Wed, 28 Jul 2004, bangerth at dealii dot org wrote:
> Not quite sure about the validity of this code (we take the address
> of a temporary -- I guess it should be valid, but undefined), but
> this nasty error message that is ten times as long as the code in
> question is not appropriate:
The compound literal has automatic storage duration associated with the
enclosing block. The code looks perfectly reasonable to me.
> ---------------------
> typedef int I2[2];
> int main () {
> int *p = (I2) {1,2};
> }
> ---------------------
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16809
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/16809] [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
2004-07-28 21:33 [Bug middle-end/16809] New: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers bangerth at dealii dot org
` (2 preceding siblings ...)
2004-07-28 21:51 ` jsm at polyomino dot org dot uk
@ 2004-07-28 21:52 ` bangerth at ices dot utexas dot edu
2004-07-28 21:53 ` bangerth at ices dot utexas dot edu
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bangerth at ices dot utexas dot edu @ 2004-07-28 21:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at ices dot utexas dot edu 2004-07-28 21:52 -------
Subject: Re: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
> Before we errored:
> input.cc: In function `int main()':
> input.cc:3: error: initializer for scalar variable requires one element
>
> So this is a regression no matter what, either we are ICEing when we should
> not be or we are accepting invalid code when we should not be.
My naive understanding is that we should accept this. We initialize a pointer
to int with an array of two integers. The array should simply decay to a
pointer. icc8 thinks the same, btw. I'm sure JSM can help us here, though.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ices.utexas.edu
www: http://www.ices.utexas.edu/~bangerth/
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16809
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/16809] [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
2004-07-28 21:33 [Bug middle-end/16809] New: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers bangerth at dealii dot org
` (3 preceding siblings ...)
2004-07-28 21:52 ` bangerth at ices dot utexas dot edu
@ 2004-07-28 21:53 ` bangerth at ices dot utexas dot edu
2004-07-28 22:17 ` jsm at polyomino dot org dot uk
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: bangerth at ices dot utexas dot edu @ 2004-07-28 21:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at ices dot utexas dot edu 2004-07-28 21:53 -------
Subject: Re: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
> The compound literal has automatic storage duration associated with the
> enclosing block. The code looks perfectly reasonable to me.
Ah, speaking of the devil :-))
Thanks, Joseph, for clarifying the matter!
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ices.utexas.edu
www: http://www.ices.utexas.edu/~bangerth/
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16809
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/16809] [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
2004-07-28 21:33 [Bug middle-end/16809] New: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers bangerth at dealii dot org
` (4 preceding siblings ...)
2004-07-28 21:53 ` bangerth at ices dot utexas dot edu
@ 2004-07-28 22:17 ` jsm at polyomino dot org dot uk
2004-07-28 22:26 ` bangerth at dealii dot org
2004-08-25 10:38 ` reichelt at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: jsm at polyomino dot org dot uk @ 2004-07-28 22:17 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From jsm at polyomino dot org dot uk 2004-07-28 22:17 -------
Subject: Re: [3.5 regression] ICE in gimplify_expr
with initializer of arrays and pointers
On Wed, 28 Jul 2004, bangerth at ices dot utexas dot edu wrote:
> > The compound literal has automatic storage duration associated with the
> > enclosing block. The code looks perfectly reasonable to me.
>
> Ah, speaking of the devil :-))
>
> Thanks, Joseph, for clarifying the matter!
I should perhaps note that I don't know what state the implementation of
compound literals as an extension for C++ is in, but clearly the semantics
used in C++ ought to follow those in C99 as closely as possible (modulo
C++ differences such as allowing non-constants in those of static storage
duration), meaning this case should work just as it does in C. The C++
front end may need changing to use COMPOUND_LITERAL_EXPRs like C does
(rather than just CONSTRUCTORs).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16809
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/16809] [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
2004-07-28 21:33 [Bug middle-end/16809] New: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers bangerth at dealii dot org
` (5 preceding siblings ...)
2004-07-28 22:17 ` jsm at polyomino dot org dot uk
@ 2004-07-28 22:26 ` bangerth at dealii dot org
2004-08-25 10:38 ` reichelt at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: bangerth at dealii dot org @ 2004-07-28 22:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-07-28 22:26 -------
Forgot to say that: the snippet compiles just fine when one uses the
C frontend. It is the C++ front end that generates something that
trips up gimplify_expr.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16809
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug middle-end/16809] [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers
2004-07-28 21:33 [Bug middle-end/16809] New: [3.5 regression] ICE in gimplify_expr with initializer of arrays and pointers bangerth at dealii dot org
` (6 preceding siblings ...)
2004-07-28 22:26 ` bangerth at dealii dot org
@ 2004-08-25 10:38 ` reichelt at gcc dot gnu dot org
7 siblings, 0 replies; 9+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-08-25 10:38 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-08-25 10:38 -------
Fixed by Andrew's patch
http://gcc.gnu.org/ml/gcc-cvs/2004-08/msg01241.html
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|NEW |RESOLVED
Keywords|accepts-invalid |
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16809
^ permalink raw reply [flat|nested] 9+ messages in thread