Bug 46377 - [4.6 regression] incorrect scalarization (3)
Summary: [4.6 regression] incorrect scalarization (3)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.6.0
: P3 normal
Target Milestone: 4.6.0
Assignee: Martin Jambor
URL:
Keywords:
Depends on:
Blocks: 46349
  Show dependency treegraph
 
Reported: 2010-11-08 17:56 UTC by Eric Botcazou
Modified: 2010-11-10 12:53 UTC (History)
1 user (show)

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


Attachments
opt11.adb (128 bytes, text/plain)
2010-11-08 17:57 UTC, Eric Botcazou
Details
opt11.ads (202 bytes, text/plain)
2010-11-08 17:58 UTC, Eric Botcazou
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Botcazou 2010-11-08 17:56:55 UTC
The fix for PR tree-opt/44972 has introduced regressions in Ada, specifically:

    (sra_modify_assign): Removed ref_expr_for_all_replacements_p checks,
    checks for return values of build_ref_for_offset.

This is a third example, potentially a duplicate of PR tree-opt/46351, but it can be reproduced on 32-bit targets:

eric@atlantis:~/build/gcc/native32> gcc/xgcc -Bgcc -S -O opt11.adb
+===========================GNAT BUG DETECTED==============================+
| 4.6.0 20101105 (experimental) [trunk revision 166350] (i586-suse-linux-gnu) GCC error:|
| in build_ref_for_offset, at tree-sra.c:1345                              |
| Error detected around opt11.adb:12:1       

The testcase is suitable for addition to the gnat.dg testsuite.
Comment 1 Eric Botcazou 2010-11-08 17:57:40 UTC
Created attachment 22332 [details]
opt11.adb
Comment 2 Eric Botcazou 2010-11-08 17:58:19 UTC
Created attachment 22333 [details]
opt11.ads
Comment 3 Martin Jambor 2010-11-09 14:33:16 UTC
Also mine.
Comment 4 Martin Jambor 2010-11-09 17:25:04 UTC
Patch submitted to the mailing list:

http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00933.html
Comment 5 Martin Jambor 2010-11-10 12:52:32 UTC
Author: jamborm
Date: Wed Nov 10 12:52:27 2010
New Revision: 166535

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166535
Log:
2010-11-10  Martin Jambor  <mjambor@suse.cz>

	PR tree-optimization/46351
	PR tree-optimization/46377
	* tree-sra.c (type_internals_preclude_sra_p): Disqualify types with
	aggregate bit-fields.

	* testsuite/gnat.dg/opt10.adb: New file.
	* testsuite/gnat.dg/opt10_pkg.ads: Likewise.
	* testsuite/gnat.dg/opt11.adb: Likewise.
	* testsuite/gnat.dg/opt11.ads: Likewise.


Added:
    trunk/gcc/testsuite/gnat.dg/opt10.adb
    trunk/gcc/testsuite/gnat.dg/opt10_pkg.ads
    trunk/gcc/testsuite/gnat.dg/opt11.adb
    trunk/gcc/testsuite/gnat.dg/opt11.ads
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c
Comment 6 Martin Jambor 2010-11-10 12:53:41 UTC
Fixed.