Bug 48456 - [4.6/4.7 Regression] Realloc on assignment: ICE in fold_binary_loc
[4.6/4.7 Regression] Realloc on assignment: ICE in fold_binary_loc
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: fortran
4.7.0
: P4 normal
: 4.6.1
Assigned To: Paul Thomas
: ice-on-valid-code
Depends on: 48360
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-05 08:43 UTC by Tobias Burnus
Modified: 2011-04-13 19:21 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.2, 4.3.4, 4.4.0, 4.5.2
Known to fail: 4.6.0, 4.7.0
Last reconfirmed: 2011-04-05 08:51:15


Attachments
Test case (2.06 KB, text/plain)
2011-04-05 08:43 UTC, Tobias Burnus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2011-04-05 08:43:40 UTC
Created attachment 23880 [details]
Test case

Reported by Douglas Foulds at http://gcc.gnu.org/ml/fortran/2011-04/msg00033.html

Said to fail (on Windows/MinGW) with:
  4.6.0 20110214 (experimental) [trunk revision 170140]
said to work with:
  4.6.0 20101027 (experimental) [trunk revision 166022]

Fails also with the current 4.7 trunk (on x86-64-linux).


The attached program fails with:

test.f90: In function ‘print_after_transfer’:
test.f90:99:0: internal compiler error: in fold_binary_loc, at fold-const.c:9324
Comment 1 Tobias Burnus 2011-04-05 08:48:34 UTC
The test case works with -fno-realloc-lhs.

Thus, it might be related to PR 48360 (there one has a segfault and no ICE).
Comment 2 Dominique d'Humieres 2011-04-05 08:51:15 UTC
Confirmed on x86_64-apple-darwin10.7.0. The breakage occurred between revisions 167173 and 167584.
Comment 3 Paul Thomas 2011-04-08 04:32:57 UTC
Obviously mine.

It seems to go away with my fix for PR48360, although I will have to verify that this weekend.

Paul
Comment 4 Paul Thomas 2011-04-12 19:14:53 UTC
Author: pault
Date: Tue Apr 12 19:14:49 2011
New Revision: 172339

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172339
Log:
2011-04-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/48360
	PR fortran/48456
	* trans-array.c (get_std_lbound): For derived type variables
	return array valued component lbound.

2011-04-12  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/48360
	PR fortran/48456
	* gfortran.dg/realloc_on_assign_6.f03: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/realloc_on_assign_6.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/testsuite/ChangeLog
Comment 5 Paul Thomas 2011-04-13 18:38:21 UTC
Author: pault
Date: Wed Apr 13 18:38:17 2011
New Revision: 172390

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=172390
Log:
2011-04-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/48360
	PR fortran/48456
	* trans-array.c (get_std_lbound): For derived type variables
	return array valued component lbound.

2011-04-13  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/48360
	PR fortran/48456
	* gfortran.dg/realloc_on_assign_6.f03: New test.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/realloc_on_assign_6.f03
Modified:
    branches/gcc-4_6-branch/gcc/fortran/ChangeLog
    branches/gcc-4_6-branch/gcc/fortran/trans-array.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Comment 6 Paul Thomas 2011-04-13 19:21:01 UTC
Fixed on trunk and 4.6.

Thanks for the report

Paul