This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/78646] incorrect result type for pointer addition in slsr
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Dec 2016 12:18:29 +0000
- Subject: [Bug tree-optimization/78646] incorrect result type for pointer addition in slsr
- Auto-submitted: auto-generated
- References: <bug-78646-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78646
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wschmidt at linux dot vnet.ibm.com
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
- add_expr = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (c->base_expr),
+ gcc_assert (POINTER_TYPE_P (c->cand_type));
+ add_expr = fold_build2 (POINTER_PLUS_EXPR,
+ build_pointer_type (TREE_TYPE (c->cand_type)),
c->base_expr, c->stride);
if it is already a pointer type there's no need to build another one.
Can't reproduce the ICE on the GCC 5 branch (on x86_64-linux, with -m32 or
-m64).