Bug 27721 - [4.1/4.2 regression] ICE using += with a function
Summary: [4.1/4.2 regression] ICE using += with a function
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.2.0
: P2 minor
Target Milestone: 4.1.2
Assignee: Volker Reichelt
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-invalid-code, monitored, patch
: 29220 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-05-22 13:28 UTC by Volker Reichelt
Modified: 2006-09-25 21:24 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-05-22 13:28:11 UTC
The following invalid code snippet triggers an ICE in the C frontend
since GCC 4.1.0:

======================
void foo()
{
    int i();
    i += 0;
}
======================

bug.c: In function 'foo':
bug.c:4: internal compiler error: in default_conversion, at c-typeck.c:1619
Please submit a full bug report, [etc.]
Comment 1 Mark Mitchell 2006-05-25 02:35:10 UTC
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Comment 2 Volker Reichelt 2006-07-20 01:00:08 UTC
Testing a patch.
Comment 3 patchapp@dberlin.org 2006-07-20 14:55:18 UTC
Subject: Bug number PR c/27721

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00855.html
Comment 4 Volker Reichelt 2006-08-05 23:26:46 UTC
Subject: Bug 27721

Author: reichelt
Date: Sat Aug  5 23:26:38 2006
New Revision: 115955

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115955
Log:
	PR c/27721
	* c-typeck.c (build_modify_expr): Test earlier for non-lvalues.

	* gcc.dg/lvalue-4.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/lvalue-4.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-typeck.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 Volker Reichelt 2006-08-05 23:34:01 UTC
Subject: Bug 27721

Author: reichelt
Date: Sat Aug  5 23:33:54 2006
New Revision: 115956

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115956
Log:
	PR c/27721
	* c-typeck.c (build_modify_expr): Test earlier for non-lvalues.

	* gcc.dg/lvalue-4.c: New test.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/lvalue-4.c
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/c-typeck.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 6 Volker Reichelt 2006-08-05 23:34:56 UTC
Fixed on mainline and 4.1 branch.
Comment 7 Andrew Pinski 2006-09-25 21:24:51 UTC
*** Bug 29220 has been marked as a duplicate of this bug. ***