mirror of git://gcc.gnu.org/git/gcc.git
re PR ipa/63569 (Wrong code with volatile and ICF)
Fix for PR ipa/63569. PR ipa/63569 * gcc.dg/ipa/pr63569.c: New test. PR ipa/63569 * ipa-icf-gimple.c (func_checker::compare_operand): Add missing comparison for volatile flag. From-SVN: r218949
This commit is contained in:
parent
1f8d3e84ee
commit
6b0e0695a5
|
|
@ -1,3 +1,9 @@
|
|||
2014-12-19 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR ipa/63569
|
||||
* ipa-icf-gimple.c (func_checker::compare_operand): Add missing
|
||||
comparison for volatile flag.
|
||||
|
||||
2014-12-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||
|
||||
* doc/invoke.texi (ARM options): Remove mention of Advanced RISC
|
||||
|
|
|
|||
|
|
@ -230,6 +230,9 @@ func_checker::compare_operand (tree t1, tree t2)
|
|||
tree tt1 = TREE_TYPE (t1);
|
||||
tree tt2 = TREE_TYPE (t2);
|
||||
|
||||
if (TREE_THIS_VOLATILE (t1) != TREE_THIS_VOLATILE (t2))
|
||||
return return_false_with_msg ("different operand volatility");
|
||||
|
||||
if (!func_checker::compatible_types_p (tt1, tt2))
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
2014-12-19 Martin Liska <mliska@suse.cz>
|
||||
|
||||
PR ipa/63569
|
||||
* gcc.dg/ipa/pr63569.c: New test.
|
||||
|
||||
2014-12-19 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR preprocessor/63831
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -fdump-ipa-icf-details" } */
|
||||
|
||||
static int f(int t, int *a) __attribute__((noinline));
|
||||
|
||||
static int g(int t, volatile int *a) __attribute__((noinline));
|
||||
static int g(int t, volatile int *a)
|
||||
{
|
||||
int i;
|
||||
int tt = 0;
|
||||
for(i=0;i<t;i++)
|
||||
tt += *a;
|
||||
return tt;
|
||||
}
|
||||
static int f(int t, int *a)
|
||||
{
|
||||
int i;
|
||||
int tt = 0;
|
||||
for(i=0;i<t;i++)
|
||||
tt += *a;
|
||||
return tt;
|
||||
}
|
||||
|
||||
|
||||
int h(int t, int *a)
|
||||
{
|
||||
return f(t, a) + g(t, a);
|
||||
}
|
||||
|
||||
/* { dg-final { scan-ipa-dump "different operand volatility" "icf" } } */
|
||||
/* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf" } } */
|
||||
/* { dg-final { cleanup-ipa-dump "icf" } } */
|
||||
Loading…
Reference in New Issue