[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-23 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

Bill Schmidt  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Bill Schmidt  ---
Fixed now.

Note: I will be unavailable from 2017-03-24 to 2017-03-27, so if regressions
occur, please revert and I will review upon my return.

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-23 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

--- Comment #9 from Bill Schmidt  ---
Author: wschmidt
Date: Thu Mar 23 13:13:44 2017
New Revision: 246418

URL: https://gcc.gnu.org/viewcvs?rev=246418=gcc=rev
Log:
[gcc]

2017-03-23  Bill Schmidt  
Richard Biener  

PR tree-optimization/79908
PR tree-optimization/80136
* tree-stdarg.c (expand_ifn_va_arg_1): For a VA_ARG whose LHS has
been cast away, gimplify_and_add suffices.

[gcc/testsuite]

2017-03-23  Bill Schmidt  
Richard Biener  

PR tree-optimization/79908
PR tree-optimization/80136
* gcc.dg/torture/pr79908.c: New file.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/torture/pr79908.c
trunk/gcc/tree-stdarg.c

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-21 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

--- Comment #8 from Bill Schmidt  ---
Author: wschmidt
Date: Tue Mar 21 18:14:42 2017
New Revision: 246330

URL: https://gcc.gnu.org/viewcvs?rev=246330=gcc=rev
Log:
[gcc]

2017-03-21  Bill Schmidt  

PR tree-optimization/79908
* tree-stdarg.c (expand_ifn_va_arg_1): Revert the following
change: For a VA_ARG whose LHS has been cast away, use
force_gimple_operand to construct the side effects.

[gcc/testsuite]

2017-03-21  Bill Schmidt  

PR tree-optimization/79908
* gcc.dg/torture/pr79908.c: Revert addition of new file.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.dg/torture/pr79908.c
trunk/gcc/tree-stdarg.c

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-21 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

Bill Schmidt  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #7 from Bill Schmidt  ---
This is causing failures all over on aarch64; see PR 80136
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80136).  Going to revert this fix
for now.

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-21 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

Bill Schmidt  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Bill Schmidt  ---
Fixed.

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-21 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

--- Comment #5 from Bill Schmidt  ---
Author: wschmidt
Date: Tue Mar 21 13:57:20 2017
New Revision: 246319

URL: https://gcc.gnu.org/viewcvs?rev=246319=gcc=rev
Log:
[gcc]

2017-03-21  Bill Schmidt  
Richard Biener  

PR tree-optimization/79908
* tree-stdarg.c (expand_ifn_va_arg_1): For a VA_ARG whose LHS has
been cast away, use force_gimple_operand to construct the side
effects.

[gcc/testsuite]

2017-03-21  Bill Schmidt  
Richard Biener  

PR tree-optimization/79908
* gcc.dg/torture/pr79908.c: New file.


Added:
trunk/gcc/testsuite/gcc.dg/torture/pr79908.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-stdarg.c

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-14 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

--- Comment #4 from Bill Schmidt  ---
Any fix for this must also handle this reduced test case:

typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;

void
foo (va_list args)
{
  va_list ap;
  __builtin_va_copy (ap, args);
  (void)__builtin_va_arg (ap, int);
  __builtin_va_end(ap);
}

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-14 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

--- Comment #3 from Bill Schmidt  ---
Patch isn't acceptable; still investigating.

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-13 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

Bill Schmidt  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |wschmidt at gcc dot 
gnu.org

--- Comment #2 from Bill Schmidt  ---
Patch under test:

Index: gcc/tree-stdarg.c
===
--- gcc/tree-stdarg.c   (revision 246109)   
+++ gcc/tree-stdarg.c   (working copy)  
@@ -1057,7 +1057,7 @@ expand_ifn_va_arg_1 (function *fun)
   types.  */   
gimplify_assign (lhs, expr, );  
  } 
-   else
+   else if (is_gimple_addressable (expr))  
  gimplify_expr (, , , is_gimple_lvalue, fb_lvalue);  

input_location = saved_location;

[Bug tree-optimization/79908] ICE in gimplify_expr (gimplify.c:12155) gimplification failed

2017-03-12 Thread wschmidt at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79908

Bill Schmidt  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-03-13
  Component|target  |tree-optimization
 Ever confirmed|0   |1

--- Comment #1 from Bill Schmidt  ---
Minimal test:

#include 

void testva (int n, ...)
{
  va_list ap;

  _Complex int i = va_arg (ap, _Complex int);
}

The use of a _Complex type is required to exhibit the bug (plain old int and
double work fine).

The optimizer recognizes that the assignment to i is dead, but the side effects
of va_arg present it from similarly going dead, so we end up with:

testva (int n)
{
  char * ap;

   [100.00%]:
  VA_ARG (, 0B, 0B);
  ap ={v} {CLOBBER};
  return;

}

which the gimplifier doesn't know what to do with for complex cases.

Not a target bug; changing to tree-optimization component.

Confirmed, btw.