public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/65818] [6 Regression] libiberty/vprintf-support.c:41:1: ICE: in expand_i fn_va_arg_1, at tree-stdarg.c:1095
Date: Wed, 22 Apr 2015 16:40:00 -0000	[thread overview]
Message-ID: <bug-65818-4-LkwsQ5fbXf@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65818-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65818

--- Comment #7 from vries at gcc dot gnu.org ---
Hmm, this patch has failures for x86_64:

- va_arg (ap, void):
  gcc.c-torture/compile/pr48767.c 
- vla:
  gcc.c-torture/execute/20020412-1.c
  gcc.dg/compat/struct-by-value-22
  gcc.dg/lto/20090706-1
  gcc.target/i386/memcpy-strategy-4.c

this patch is more conservative:
...
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 7786e16..e23f510 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -9336,7 +9336,12 @@ gimplify_va_arg_internal (tree valist, tree type,
location_t loc,
   else
     gimplify_expr (&valist, pre_p, post_p, is_gimple_min_lval, fb_lvalue);

-  return targetm.gimplify_va_arg_expr (valist, type, pre_p, post_p);
+  tree expr = targetm.gimplify_va_arg_expr (valist, type, pre_p, post_p);
+  gcc_assert (TREE_CODE (expr) == MEM_REF);
+  if (!is_gimple_mem_ref_addr (TREE_OPERAND (expr, 0)))
+    gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, post_p,
+                  is_gimple_mem_ref_addr, fb_rvalue);
+  return expr;
 }

 /* Gimplify __builtin_va_arg, aka VA_ARG_EXPR, which is not really a
...

It allows at least pr48767.c, 20020412-1.c and memcpy-strategy-4.c to pass.


  parent reply	other threads:[~2015-04-22 16:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 20:44 [Bug tree-optimization/65818] New: " danglin at gcc dot gnu.org
2015-04-20 20:49 ` [Bug tree-optimization/65818] " danglin at gcc dot gnu.org
2015-04-21  7:45 ` [Bug tree-optimization/65818] [6 Regression] " rguenth at gcc dot gnu.org
2015-04-21 18:50 ` vries at gcc dot gnu.org
2015-04-22  6:44 ` vries at gcc dot gnu.org
2015-04-22  7:02 ` vries at gcc dot gnu.org
2015-04-22  7:15 ` vries at gcc dot gnu.org
2015-04-22 11:25 ` dave.anglin at bell dot net
2015-04-22 16:40 ` vries at gcc dot gnu.org [this message]
2015-04-22 16:58 ` dave.anglin at bell dot net
2015-04-24 11:21 ` dave.anglin at bell dot net
2015-04-24 16:40 ` vries at gcc dot gnu.org
2015-04-24 20:30 ` vries at gcc dot gnu.org
2015-04-25 12:36 ` vries at gcc dot gnu.org
2015-04-26 11:13 ` vries at gcc dot gnu.org
2015-04-28  6:05 ` vries at gcc dot gnu.org
2015-04-28  6:10 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-65818-4-LkwsQ5fbXf@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).