public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/67873] New: ice in duplicate_ssa_name_range_info
@ 2015-10-06 20:03 dcb314 at hotmail dot com
  2015-10-07  5:26 ` [Bug tree-optimization/67873] " trippels at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: dcb314 at hotmail dot com @ 2015-10-06 20:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67873
           Summary: ice in duplicate_ssa_name_range_info
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

Created attachment 36455
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36455&action=edit
C source code

$ ../results/bin/gcc -c -O3 bug235.c
src/filer.c: In function ‘str_cut’:
src/filer.c:980:16: warning: implicit declaration of function ‘wcswidth’
[-Wimplicit-function-declaration]
src/filer.c: In function ‘str_cut2.constprop’:
src/filer.c:1015:6: internal compiler error: in duplicate_ssa_name_range_info,
at tree-ssanames.c:506
0xd9de75 duplicate_ssa_name_range_info(tree_node*, value_range_type,
range_info_def*)
        ../../src/trunk/gcc/tree-ssanames.c:506
0xd1a874 eliminate_dom_walker::before_dom_children(basic_block_def*)
        ../../src/trunk/gcc/tree-ssa-pre.c:4127
0x1256eb9 dom_walker::walk(basic_block_def*)
        ../../src/trunk/gcc/domwalk.c:177
>From gcc-bugs-return-498899-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 06 20:06:17 2015
Return-Path: <gcc-bugs-return-498899-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 39519 invoked by alias); 6 Oct 2015 20:06:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 39492 invoked by uid 48); 6 Oct 2015 20:06:13 -0000
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/67872] missing -Warray-bounds warning, bogus -Wmaybe-uninitialized
Date: Tue, 06 Oct 2015 20:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: msebor at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67872-4-AcVmRmhli0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67872-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67872-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg00454.txt.bz2
Content-length: 1305

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg872

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Looking for existing code in place to issue -Warray-bounds warnings I came
across fold_offsetof_1 in c-family/c-common.c.  The function is designed to
warn for out of bounds indices in offsetof expressions but doesn't detect the
following:

struct A {
    int a[3];
} a;

int foo (void)
{
    return __builtin_offsetof (struct A, a[4]);
}


This (otherwise untested) patch fixes it and makes the function diagnose this
case.  (The comment about flexible array members above the block suggests that
the patch might need tweaking to avoid false positives for such constructs.)

--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -10623,7 +10623,8 @@ fold_offsetof_1 (tree expr)
                     man's flexible array member with a very permissive
                     definition thereof.  */
                  if (TREE_CODE (v) == ARRAY_REF
-                     || TREE_CODE (v) == COMPONENT_REF)
+                     || TREE_CODE (v) == COMPONENT_REF
+                     || TREE_CODE (v) == INDIRECT_REF)
                    warning (OPT_Warray_bounds,
                             "index %E denotes an offset "
                             "greater than size of %qT",


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug tree-optimization/67873] ice in duplicate_ssa_name_range_info
  2015-10-06 20:03 [Bug c/67873] New: ice in duplicate_ssa_name_range_info dcb314 at hotmail dot com
@ 2015-10-07  5:26 ` trippels at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-10-07  5:26 UTC (permalink / raw)
  To: gcc-bugs

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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |trippels at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
dup, already fixed.

*** This bug has been marked as a duplicate of bug 67821 ***


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-07  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-06 20:03 [Bug c/67873] New: ice in duplicate_ssa_name_range_info dcb314 at hotmail dot com
2015-10-07  5:26 ` [Bug tree-optimization/67873] " trippels at gcc dot gnu.org

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