Bug 50613 - [4.7 Regression] ICE: tree check: expected ssa_name, have addr_expr in find_equal_ptrs, at tree-ssa-strlen.c:712 with -foptimize-strlen -fno-tree-ccp
Summary: [4.7 Regression] ICE: tree check: expected ssa_name, have addr_expr in find_e...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-10-04 17:24 UTC by Zdenek Sojka
Modified: 2011-10-05 18:16 UTC (History)
1 user (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail: 4.7.0
Last reconfirmed: 2011-10-05 00:00:00


Attachments
reduced testcase (152 bytes, text/plain)
2011-10-04 17:24 UTC, Zdenek Sojka
Details
gcc47-pr50613.patch (698 bytes, patch)
2011-10-05 06:30 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2011-10-04 17:24:59 UTC
Created attachment 25413 [details]
reduced testcase

Compiler output:
$ gcc -O -foptimize-strlen -fno-tree-ccp testcase.c 
testcase.c: In function 'foo':
testcase.c:10:1: internal compiler error: tree check: expected ssa_name, have addr_expr in find_equal_ptrs, at tree-ssa-strlen.c:712
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Tested revisions:
r179488 - crash
Comment 1 Jakub Jelinek 2011-10-05 06:30:59 UTC
Created attachment 25418 [details]
gcc47-pr50613.patch

Untested fix.
Comment 2 Jakub Jelinek 2011-10-05 18:10:03 UTC
Author: jakub
Date: Wed Oct  5 18:09:56 2011
New Revision: 179567

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179567
Log:
	PR tree-optimization/50613
	* tree-ssa-strlen.c (find_equal_ptrs): If CASE_CONVERT
	operand is ADDR_EXPR, fallthru into ADDR_EXPR handling,
	and if it is neither that not SSA_NAME, give up.

	* gcc.dg/pr50613.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr50613.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-strlen.c
Comment 3 Jakub Jelinek 2011-10-05 18:16:55 UTC
Fixed.