public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/28915] [4.2 regression] ICE: tree check: expected class 'constant', have 'declaration' (var_decl) in build_vector, at tree.c:973 Date: Wed, 06 Sep 2006 06:30:00 -0000 [thread overview] Message-ID: <20060906063013.23024.qmail@sourceware.org> (raw) In-Reply-To: <bug-28915-12387@http.gcc.gnu.org/bugzilla/> ------- Comment #9 from pinskia at gcc dot gnu dot org 2006-09-06 06:30 ------- And here is a testcase which is reproducible without the vectorizer: int t[4]; __attribute__((vector_size(16))) int f(void) { __attribute__((vector_size(16))) int t1 = {(int)&t[0], (int)&t[1], (int)&t[2], (int)&t[3]}; return t1; } -------------------- That testcase above shows more problems than I actually want to touch right now. Here was my fix for the x86 crash (but it does not fix the powerpc-linux with -maltivec crash): Index: tree.c =================================================================== --- tree.c (revision 116689) +++ tree.c (working copy) @@ -969,9 +969,11 @@ build_vector (tree type, tree vals) for (link = vals; link; link = TREE_CHAIN (link)) { tree value = TREE_VALUE (link); - - over1 |= TREE_OVERFLOW (value); - over2 |= TREE_CONSTANT_OVERFLOW (value); + if (CONSTANT_CLASS_P (value)) + { + over1 |= TREE_OVERFLOW (value); + over2 |= TREE_CONSTANT_OVERFLOW (value); + } } TREE_OVERFLOW (v) = over1; Index: expmed.c =================================================================== --- expmed.c (revision 116689) +++ expmed.c (working copy) @@ -4945,6 +4945,9 @@ make_tree (tree type, rtx x) switch (GET_CODE (x)) { + case CONST: + return make_tree (type, XEXP (x, 0)); + case CONST_INT: { HOST_WIDE_INT hi = 0; @@ -4979,6 +4982,7 @@ make_tree (tree type, rtx x) int i, units; rtx elt; tree t = NULL_TREE; + tree type1 = TREE_TYPE (type); units = CONST_VECTOR_NUNITS (x); @@ -4986,7 +4990,7 @@ make_tree (tree type, rtx x) for (i = units - 1; i >= 0; --i) { elt = CONST_VECTOR_ELT (x, i); - t = tree_cons (NULL_TREE, make_tree (type, elt), t); + t = tree_cons (NULL_TREE, make_tree (type1, elt), t); } return build_vector (type, t); @@ -5044,6 +5048,14 @@ make_tree (tree type, rtx x) GET_CODE (x) == ZERO_EXTEND); return fold_convert (type, make_tree (t, XEXP (x, 0))); + case SYMBOL_REF: + if (SYMBOL_REF_DECL (x)) + { + tree pointer; + t = SYMBOL_REF_DECL (x); + pointer = build_pointer_type (TREE_TYPE (t)); + return fold_convert (type, fold_build1 (ADDR_EXPR, pointer, t)); + } default: t = build_decl (VAR_DECL, NULL_TREE, type); -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|pinskia at gcc dot gnu dot |unassigned at gcc dot gnu |org |dot org Status|ASSIGNED |NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28915
next prev parent reply other threads:[~2006-09-06 6:30 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2006-08-31 12:24 [Bug tree-optimization/28915] New: " tbm at cyrius dot com 2006-08-31 12:30 ` [Bug tree-optimization/28915] " tbm at cyrius dot com 2006-08-31 16:13 ` pinskia at gcc dot gnu dot org 2006-08-31 19:15 ` uros at kss-loka dot si 2006-08-31 19:21 ` pinskia at gcc dot gnu dot org 2006-08-31 19:28 ` tbm at cyrius dot com 2006-09-01 6:27 ` pinskia at gcc dot gnu dot org 2006-09-01 22:32 ` mmitchel at gcc dot gnu dot org 2006-09-04 17:07 ` [Bug middle-end/28915] " pinskia at gcc dot gnu dot org 2006-09-05 4:20 ` pinskia at gcc dot gnu dot org 2006-09-06 6:30 ` pinskia at gcc dot gnu dot org [this message] 2006-09-06 6:33 ` pinskia at gcc dot gnu dot org 2006-09-06 15:27 ` roger at eyesopen dot com 2006-09-06 15:37 ` roger at eyesopen dot com 2006-09-09 6:44 ` jason at gcc dot gnu dot org 2006-09-10 0:48 ` jason at gcc dot gnu dot org 2006-09-22 4:36 ` rsandifo at gcc dot gnu dot org 2006-10-01 4:33 ` [Bug middle-end/28915] [4.1/4.2 " pinskia at gcc dot gnu dot org 2006-11-11 2:19 ` [Bug middle-end/28915] [4.1/4.2/4.3 " roger at eyesopen dot com 2006-11-13 8:16 ` jason at gcc dot gnu dot org 2006-11-13 8:19 ` jason at gcc dot gnu dot org 2006-11-13 14:41 ` [Bug middle-end/28915] [4.1 " pinskia at gcc dot gnu dot org 2006-11-13 18:53 ` hjl at gcc dot gnu dot org 2006-11-13 18:55 ` hjl at gcc dot gnu dot org 2006-11-13 23:31 ` jason at gcc dot gnu dot org 2006-11-13 23:42 ` jason at gcc dot gnu dot org 2006-11-14 9:30 ` jakub at gcc dot gnu dot org 2006-11-14 10:02 ` Andrew Pinski 2006-11-14 10:03 ` pinskia at gmail dot com 2006-12-01 1:09 ` chaoyingfu at gcc dot gnu dot 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=20060906063013.23024.qmail@sourceware.org \ --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: linkBe 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).