This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/78646] incorrect result type for pointer addition in slsr


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).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]