Created attachment 39902 [details] C source code The attached code, when compiled by gcc dated 20161026, and compiler flags -O2 -ansi, does this: $ ../results/bin/gcc -c -ansi -O2 bug317.c 2>&1 | more output.c: In function ‘indicate_special’: output.c:778:1: internal compiler error: in set_value_range, at tree-vrp.c:367 0xed2af0 set_value_range ../../trunk/gcc/tree-vrp.c:367 0xed4b9c get_value_range ../../trunk/gcc/tree-vrp.c:699 0xed4e34 vrp_valueize ../../trunk/gcc/tree-vrp.c:7054 0x105d4bf do_valueize ../../trunk/gcc/gimple-match-head.c:557 I'll have a go at reducing the source code file.
After reduction. a; static fn1(c) unsigned char c; { if (a) fn2(c); fn1('#'); } fn3() { fn1('�'); } The blotch character in the quotes near the end seems to have ASCII value 267. Dunno why it's not displaying correctly.
(In reply to David Binderman from comment #1) > The blotch character in the quotes near the end seems to have ASCII value > 267. > Dunno why it's not displaying correctly. 267 is a tad high for a char that supposedly can only go to 255. Suspect octal 267. Probably character b7, in hex. Output from od, if that helps
Looks like ipa-vrp issue. I will have a look.
Created attachment 39904 [details] untested patch testing this patch
(In reply to kugan from comment #4) > Created attachment 39904 [details] > untested patch > > testing this patch patch any good ?
(In reply to David Binderman from comment #5) > (In reply to kugan from comment #4) > > Created attachment 39904 [details] > > untested patch > > > > testing this patch > > patch any good ? Posted at https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02309.html waiting for Honza's approval.
Author: kugan Date: Wed Nov 9 01:41:26 2016 New Revision: 241989 URL: https://gcc.gnu.org/viewcvs?rev=241989&root=gcc&view=rev Log: Fix ice in set_value_range gcc/ChangeLog: 2016-11-09 Kugan Vivekanandarajah <kuganv@linaro.org> PR ipa/78121 * ipa-cp.c (propagate_vr_accross_jump_function): Pass param type. Also fold constant passed as argument while computing value range. (propagate_constants_accross_call): Pass param type. * ipa-prop.c: export ipa_get_callee_param_type. * ipa-prop.h: export ipa_get_callee_param_type. gcc/testsuite/ChangeLog: 2016-11-09 Kugan Vivekanandarajah <kuganv@linaro.org> PR ipa/78121 * gcc.dg/ipa/pr78121.c: New test. Added: trunk/gcc/testsuite/gcc.dg/ipa/pr78121.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-cp.c trunk/gcc/ipa-prop.c trunk/gcc/ipa-prop.h trunk/gcc/testsuite/ChangeLog
Fixed in mainline.
*** Bug 78258 has been marked as a duplicate of this bug. ***