Bug 54559 - [4.7/4.8 Regression], ICE in gimplify_expr, at gimplify.c:7592
Summary: [4.7/4.8 Regression], ICE in gimplify_expr, at gimplify.c:7592
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.7.2
: P1 normal
Target Milestone: 4.7.2
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2012-09-12 16:26 UTC by Matthias Klose
Modified: 2012-09-14 06:11 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.6.3, 4.7.1
Known to fail: 4.7.2, 4.8.0
Last reconfirmed: 2012-09-13 00:00:00


Attachments
gcc48-pr54559.patch (684 bytes, patch)
2012-09-13 09:31 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2012-09-12 16:26:50 UTC
fails with r191092, worked with r190380 on the 4.7 branch, taken from a cython testcase, with -O[0-3]:

$ gcc -c -g -O0 -I/usr/include/python2.7 pyx.c
pyx.c: In function '__pyx_t_long_double_complex_from_parts':
pyx.c:14:16: internal compiler error: in gimplify_expr, at gimplify.c:7592
Please submit a full bug report,
with preprocessed source if appropriate.

typedef struct {
    double real;
    double imag;
} Py_complex;

typedef struct _object {
    unsigned int refcnt;
} PyObject;

typedef long double _Complex __pyx_t_long_double_complex;

static __inline__ __pyx_t_long_double_complex
__pyx_t_long_double_complex_from_parts(long double x, long double y)
{
    return x + y*(__pyx_t_long_double_complex)(__extension__ 1.0iF);
}

static __pyx_t_long_double_complex
__Pyx_PyComplex_As___pyx_t_long_double_complex(PyObject* o) {
    Py_complex cval;
    return __pyx_t_long_double_complex_from_parts(
               (long double)cval.real,
               (long double)cval.imag);
}
Comment 1 H.J. Lu 2012-09-13 03:42:17 UTC
It was caused by revision 190899:

http://gcc.gnu.org/ml/gcc-cvs/2012-09/msg00056.html
Comment 2 Jakub Jelinek 2012-09-13 09:31:34 UTC
Created attachment 28185 [details]
gcc48-pr54559.patch

Untested fix.
Comment 3 Richard Biener 2012-09-13 09:33:43 UTC
Trunk also fails for me.  P1.
Comment 4 Jakub Jelinek 2012-09-13 16:57:31 UTC
Author: jakub
Date: Thu Sep 13 16:57:15 2012
New Revision: 191270

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191270
Log:
	PR c/54559
	* c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or
	COMPLEX_TYPE with in_late_binary_op set temporarily to true.

	* gcc.c-torture/compile/pr54559.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr54559.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 Jakub Jelinek 2012-09-13 17:04:59 UTC
Author: jakub
Date: Thu Sep 13 17:04:44 2012
New Revision: 191271

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191271
Log:
	PR c/54559
	* c-typeck.c (c_finish_return): Do convert to BOOLEAN_TYPE or
	COMPLEX_TYPE with in_late_binary_op set temporarily to true.

	* gcc.c-torture/compile/pr54559.c: New test.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/gcc.c-torture/compile/pr54559.c
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/c-typeck.c
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Comment 6 Jakub Jelinek 2012-09-14 06:11:50 UTC
Fixed.