re PR middle-end/63237 (error: invalid operand in unary operation)
2014-09-12 Richard Biener <rguenther@suse.de> PR middle-end/63237 * gimple-fold.c (get_maxval_strlen): Gimplify string length. * g++.dg/torture/pr63237.C: New testcase. From-SVN: r215212
This commit is contained in:
parent
d9a72d17e6
commit
2813904b11
4 changed files with 32 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-09-12 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/63237
|
||||
* gimple-fold.c (get_maxval_strlen): Gimplify string length.
|
||||
|
||||
2014-09-12 Marc Glisse <marc.glisse@inria.fr>
|
||||
|
||||
* tree.c (integer_each_onep): New function.
|
||||
|
|
|
@ -2411,6 +2411,7 @@ gimple_fold_builtin_strlen (gimple_stmt_iterator *gsi)
|
|||
tree len = get_maxval_strlen (gimple_call_arg (stmt, 0), 0);
|
||||
if (!len)
|
||||
return false;
|
||||
len = force_gimple_operand_gsi (gsi, len, true, NULL, true, GSI_SAME_STMT);
|
||||
replace_call_with_value (gsi, len);
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2014-09-12 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/63237
|
||||
* g++.dg/torture/pr63237.C: New testcase.
|
||||
|
||||
2014-09-12 Marc Glisse <marc.glisse@inria.fr>
|
||||
|
||||
* gcc.dg/vec-andxor1.c: New file.
|
||||
|
|
21
gcc/testsuite/g++.dg/torture/pr63237.C
Normal file
21
gcc/testsuite/g++.dg/torture/pr63237.C
Normal file
|
@ -0,0 +1,21 @@
|
|||
// { dg-do compile }
|
||||
|
||||
class A {
|
||||
int Length;
|
||||
public:
|
||||
A(const char *p1) { Length = __builtin_strlen(p1); }
|
||||
};
|
||||
class B {
|
||||
public:
|
||||
void m_fn1(int, A);
|
||||
};
|
||||
class C {
|
||||
public:
|
||||
B &m_fn2();
|
||||
};
|
||||
int a;
|
||||
void RewriteMacrosInInput() {
|
||||
C b;
|
||||
B &c = b.m_fn2();
|
||||
c.m_fn1(0, &""[a]);
|
||||
}
|
Loading…
Add table
Reference in a new issue