This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/81737] [8 Regression] 164.gzip in SPEC CPU 2000 failed to build
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 06 Aug 2017 16:15:53 +0000
- Subject: [Bug middle-end/81737] [8 Regression] 164.gzip in SPEC CPU 2000 failed to build
- Auto-submitted: auto-generated
- References: <bug-81737-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81737
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Untested, but this should fix it:
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -14107,8 +14107,10 @@ fold_indirect_ref_1 (location_t loc, tree type, tree
op0)
&& type == TREE_TYPE (op00type))
{
tree type_domain = TYPE_DOMAIN (op00type);
- tree min = TYPE_MIN_VALUE (type_domain);
- if (min && TREE_CODE (min) == INTEGER_CST)
+ tree min;
+ if (type_domain != NULL_TREE
+ && (min = TYPE_MIN_VALUE (type_domain))
+ && TREE_CODE (min) == INTEGER_CST)
{
offset_int off = wi::to_offset (op01);
offset_int el_sz = wi::to_offset (TYPE_SIZE_UNIT (type));