public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/93044] extra cast is not removed
       [not found] <bug-93044-4@http.gcc.gnu.org/bugzilla/>
@ 2019-12-22 13:43 ` glisse at gcc dot gnu.org
  2021-11-22  9:25 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: glisse at gcc dot gnu.org @ 2019-12-22 13:43 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 154795 bytes --]

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

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
In match.pd

         && ((inter_unsignedp && inter_prec > inside_prec)
             == (final_unsignedp && final_prec > inter_prec))

looks suspicious.
>From gcc-bugs-return-663934-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 22 15:29:49 2019
Return-Path: <gcc-bugs-return-663934-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 68224 invoked by alias); 22 Dec 2019 15:29:48 -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 68176 invoked by uid 48); 22 Dec 2019 15:29:44 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/92976] [8/9/10 Regression][OOP] ICE in trans_associate_var, at fortran/trans-stmt.c:1963
Date: Sun, 22 Dec 2019 15:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc target_milestone
Message-ID: <bug-92976-4-KTLD23jp7y@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92976-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92976-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02004.txt.bz2
Content-length: 369

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org
   Target Milestone|---                         |10.0
>From gcc-bugs-return-663935-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 22 16:10:35 2019
Return-Path: <gcc-bugs-return-663935-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 117573 invoked by alias); 22 Dec 2019 16:10:35 -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 117532 invoked by uid 48); 22 Dec 2019 16:10:31 -0000
From: "rene.rahn@fu-berlin.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/93034] variant not constexpr in c++17 mode
Date: Sun, 22 Dec 2019 16:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 7.5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rene.rahn@fu-berlin.de
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: WONTFIX
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-93034-4-qItY6vdcco@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93034-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93034-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02005.txt.bz2
Content-length: 144

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

--- Comment #2 from rene.rahn@fu-berlin.de ---
ok, thanks for the heads up.

best regards
>From gcc-bugs-return-663936-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 22 20:01:58 2019
Return-Path: <gcc-bugs-return-663936-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 35659 invoked by alias); 22 Dec 2019 20:01:58 -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 35611 invoked by uid 48); 22 Dec 2019 20:01:53 -0000
From: "david at doublewise dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/52981] Separate -Wpadded into two options
Date: Sun, 22 Dec 2019 20:01: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: 4.7.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: david at doublewise dot net
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-52981-4-cUM80XYVxD@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-52981-4@http.gcc.gnu.org/bugzilla/>
References: <bug-52981-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02006.txt.bz2
Content-length: 1107

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

--- Comment #9 from David Stone <david at doublewise dot net> ---
It might further be worth giving the "you can rearrange to save sapce" option
two warning levels. The highest level would warn for all cases where
rearranging can reduce size, and the lowest level would warn for all cases
where rearranging only the private data members can reduce size. This is a
potentially important point because rearranging public / protected data members
can affect the API of your type by changing how it interacts with structured
bindings, and, if it is also an aggregate, aggregate construction.

The important new consideration that has the potential for a third warning
option is the handling of empty types. It could be useful to have a warning
that alerts the user that marking a data member with [[no_unique_address]]
would reduce the size of their structure. A potential name for this is
-Wempty-data-member-wastes-space or -Wmissing-no-unique-address.

Cross posted to the equivalent clang bug report:
https://bugs.llvm.org/show_bug.cgi?id=22442#c5
>From gcc-bugs-return-663937-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 22 20:44:16 2019
Return-Path: <gcc-bugs-return-663937-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 91226 invoked by alias); 22 Dec 2019 20:44:16 -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 91195 invoked by uid 48); 22 Dec 2019 20:44:12 -0000
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/92873] ICE in unmodified_parm_or_parm_agg_item, at ipa-fnsummary.c:1166
Date: Sun, 22 Dec 2019 20:44:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: anlauf at gcc dot gnu.org
X-Bugzilla-Status: NEW
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: cc
Message-ID: <bug-92873-4-yW9X6HJOI6@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92873-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92873-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02007.txt.bz2
Content-length: 628

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
Adding a declaration of sub as elemental seems to avoid the ICE:

  elemental subroutine sub (x)
    character(*), intent(in) :: x
  end subroutine sub

whereas a non-elemental version does not help:

  subroutine sub (x)
    character(*), intent(in) :: x(:)
  end subroutine sub
>From gcc-bugs-return-663938-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 22 21:16:09 2019
Return-Path: <gcc-bugs-return-663938-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4277 invoked by alias); 22 Dec 2019 21:16:08 -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 4245 invoked by uid 48); 22 Dec 2019 21:16:04 -0000
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/91960] ICE: backend decl for module variable 'j' already exists
Date: Sun, 22 Dec 2019 21:16:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: anlauf at gcc dot gnu.org
X-Bugzilla-Status: NEW
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: bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-91960-4-j5IvcpS9UC@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91960-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91960-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02008.txt.bz2
Content-length: 977

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-12-22
                 CC|                            |anlauf at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

We fail to detect that j is used in an initialization expression.

As a consequence, we end up with junk later on.  E.g.:

module m
  implicit none
  integer :: i, j
  integer, parameter :: a(3) = [1, 2, 3]
  integer, parameter :: c    = a(j)
  integer            :: d    = c
end

produces:

pr91960b.f90:6:30:

    6 |   integer            :: d    = c
      |                              1
Error: non-constant initialization expression at (1)
>From gcc-bugs-return-663939-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Dec 22 21:52:26 2019
Return-Path: <gcc-bugs-return-663939-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27981 invoked by alias); 22 Dec 2019 21:52:26 -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 27941 invoked by uid 48); 22 Dec 2019 21:52:22 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/52981] Separate -Wpadded into two options
Date: Sun, 22 Dec 2019 21:52: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: 4.7.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: NEW
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: keywords bug_status cf_reconfirmed_on cc see_also everconfirmed
Message-ID: <bug-52981-4-u2gP0h6o9E@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-52981-4@http.gcc.gnu.org/bugzilla/>
References: <bug-52981-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02009.txt.bz2
Content-length: 1333

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-12-22
                 CC|                            |egallager at gcc dot gnu.org
           See Also|                            |https://bugs.llvm.org/show_
                   |                            |bug.cgi?id=22442
     Ever confirmed|0                           |1

--- Comment #10 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Aaron S. Kurland from comment #1)
> I just realized that my original message was referring to the wrong option.
> I meant: -Wpadded
> 
> I am therefore requesting two new options:
> 
> -Wpadded-element and -Wpadded-structure
> 
> Sorry for the confusion.

Confirmed, I have wanted a split like this as well.

(In reply to Manuel López-Ibáñez from comment #4)
> 
> [*] (I like David Stone's proposal of -Wpadded-in-middle and
> -Wpadded-at-end, but whoever implements it gets to choose the names)

Those are good name suggestions too.
>From gcc-bugs-return-663940-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 03:50:33 2019
Return-Path: <gcc-bugs-return-663940-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 52310 invoked by alias); 23 Dec 2019 03:50:33 -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 52260 invoked by uid 48); 23 Dec 2019 03:50:27 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/88518] Function call defeats -Wuninitialized
Date: Mon, 23 Dec 2019 03:50:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: egallager 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-88518-4-qwQsk8rcIA@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-88518-4@http.gcc.gnu.org/bugzilla/>
References: <bug-88518-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02010.txt.bz2
Content-length: 946

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

--- Comment #5 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Matthew Wilcox from comment #2)
> Thanks!  What I actually want to do is annotate g() to the effect that it
> reads the pointed-to variable before it writes it.  IOW, I want to write
> something like:
> 
> void g(unsigned long __attribute__((read_before_write)) *p);
> void h(void);
> 
> void f(void)
> {
>         unsigned long i;
> 
>         h();
>         g(&i);
> }
> 
> and have gcc emit a warning that i is used uninitialised.  I tried adding i
> = i prior to the call of g() through macro trickery, but was surprised that
> it didn't trigger, and simplified down to this test-case.
> 
> Any chance I could get that attribute or something like it?

The object access attributes that Martin Sebor added recently might work
somewhat along these lines, but I haven't actually tested yet...
>From gcc-bugs-return-663941-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 03:52:58 2019
Return-Path: <gcc-bugs-return-663941-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 54261 invoked by alias); 23 Dec 2019 03:52:58 -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 54202 invoked by uid 48); 23 Dec 2019 03:52:55 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/82179] Optionally compile free calls in such a way that the passed pointer is clobbered after the call
Date: Mon, 23 Dec 2019 03:52: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: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: NEW
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-82179-4-BUhxuYL35b@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-82179-4@http.gcc.gnu.org/bugzilla/>
References: <bug-82179-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02011.txt.bz2
Content-length: 645

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

--- Comment #6 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #5)
> (In reply to Federico Bento from comment #1)
> > 
> > https://sourceware.org/ml/libc-alpha/2017-09/msg00238.html
> > https://sourceware.org/ml/libc-alpha/2017-09/msg00423.html
> > 
> 
> In this, Martin said, "David Malcolm has done some preliminary work
> on a GCC maaloc/free optimization and diagnostic pass that might be
> well suited to this sort of instrumentation," so cc-ing him.

The static analyzer he's developing might also be relevant for things like this
>From gcc-bugs-return-663942-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 03:58:14 2019
Return-Path: <gcc-bugs-return-663942-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 57663 invoked by alias); 23 Dec 2019 03:58:14 -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 57471 invoked by uid 48); 23 Dec 2019 03:58:10 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/88737] RFE: Track ownership moves
Date: Mon, 23 Dec 2019 03:58: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: unknown
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: egallager 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-88737-4-ylaWGAZsaZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-88737-4@http.gcc.gnu.org/bugzilla/>
References: <bug-88737-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02012.txt.bz2
Content-length: 2699

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

--- Comment #8 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Neal H. Walfield from comment #0)
> I would like an attribute to indicate that ownership of an argument is moved
> to the function.  That is, any subsequent accesses to the variable should be
> considered invalid, and gcc should emit a warning, if possible.
> 
> Consider the following example:
> 
> ```
> #include <stdlib.h>
> #include <stdio.h>
> 
> int
> main(int argc, char *argv[]) {
>   int *a = malloc(sizeof(int));
>   *a = 1;
>   printf("%d\n", *a);
>   free(a);
>   printf("%d\n", *a);
> 
>   return 0;
> }
> ```
> 
> Compiling this with -Wall (using gcc 6.3.0-18+deb9u1 from Debian) does not
> emit a warning even though there is a use-after-free bug.
> 
> Although freeing a variable is the most obvious example of this pattern,
> this pattern often arises when dealing with pointers.
> 
> This RFE is based on my experience using Rust's lifetimes, which prevent
> this type of error in Rust.

I tested this with David Malcolm's static analyzer branch on Godbolt and it
catches it: https://godbolt.org/z/LWzGA5
Output:
<source>: In function 'main':

<source>:7:6: warning: dereference of possibly-NULL 'a' [CWE-690]
[-Wanalyzer-possible-null-dereference]

    7 |   *a = 1;

      |   ~~~^~~

  'main': events 1-2

    |

    |    6 |   int *a = malloc(sizeof(int));

    |      |            ^~~~~~~~~~~~~~~~~~~

    |      |            |

    |      |            (1) this call could return NULL

    |    7 |   *a = 1;

    |      |   ~~~~~~    

    |      |      |

    |      |      (2) 'a' could be NULL: unchecked value from (1)

    |

<source>:10:3: warning: use after 'free' of 'a' [CWE-416]
[-Wanalyzer-use-after-free]

   10 |   printf("%d\n", *a);

      |   ^~~~~~~~~~~~~~~~~~

  'main': events 1-4

    |

    |    6 |   int *a = malloc(sizeof(int));

    |      |            ^~~~~~~~~~~~~~~~~~~

    |      |            |

    |      |            (1) allocated here

    |    7 |   *a = 1;

    |      |   ~~~~~~    

    |      |      |

    |      |      (2) assuming 'a' is non-NULL

    |    8 |   printf("%d\n", *a);

    |      |   ~~~~~~~~~~~~~~~~~~

    |      |   |

    |      |   (3) freed here

    |    9 |   free(a);

    |   10 |   printf("%d\n", *a);

    |      |   ~~~~~~~~~~~~~~~~~~

    |      |   |

    |      |   (4) use after 'free' of 'a'; freed at (3)

    |

<source>:10:3: warning: use after 'free' of 'a' [CWE-416]
[-Wanalyzer-use-after-free]

   10 |   printf("%d\n", *a);

      |   ^~~~~~~~~~~~~~~~~~

  'main': event 1

    |

    |

Compiler returned: 0
>From gcc-bugs-return-663943-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 04:03:11 2019
Return-Path: <gcc-bugs-return-663943-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 64699 invoked by alias); 23 Dec 2019 04:03:11 -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 64632 invoked by uid 48); 23 Dec 2019 04:03:06 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/90906] diagnose returning pointers to freed memory
Date: Mon, 23 Dec 2019 04:03:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 9.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: NEW
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-90906-4-OzNNCIIkQn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-90906-4@http.gcc.gnu.org/bugzilla/>
References: <bug-90906-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02013.txt.bz2
Content-length: 1113

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

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #0)
> GCC doesn't diagnose returning a freed pointer as in the function below:
> 
>   void* f (void *p)
>   {
>     __builtin_free (p);
>     // ...
>     return p;
>   }
> 
> It could, by performing an analysis similar to -Wreturn-local-addr.  The
> detection would make it possible to find among other things bugs in C++ code
> due to returning pointers into local containers, such as:
> 
>   #include <vector>
> 
>   int* f ()
>   {
>     std::vector<int> v (3, 5);
>     return v.data ();
>   }

I tested both of these with David Malcolm's static analyzer branch on Godbolt
and it was silent on the first one, but ICEd on the second one:
https://godbolt.org/z/L38Fa_
Output:
during IPA pass: analyzer

<source>:7:3: internal compiler error: Segmentation fault

    7 |   }

      |   ^

Please submit a full bug report,

with preprocessed source if appropriate.

See <https://gcc.gnu.org/bugs/> for instructions.

Compiler returned: 1
>From gcc-bugs-return-663944-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 04:06:21 2019
Return-Path: <gcc-bugs-return-663944-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 67112 invoked by alias); 23 Dec 2019 04:06:21 -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 67048 invoked by uid 48); 23 Dec 2019 04:06:16 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/90806] Warray-bounds-2.c fail on cross-aarch64 on RH6 host
Date: Mon, 23 Dec 2019 04:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: testsuite
X-Bugzilla-Version: 6.4.1
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: egallager 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: blocked
Message-ID: <bug-90806-4-ijh8i5DRgA@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-90806-4@http.gcc.gnu.org/bugzilla/>
References: <bug-90806-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02014.txt.bz2
Content-length: 1095

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |84774

--- Comment #7 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #5)
> Are the same messages issued by GCC when the test is compiled by hand?  Are
> the translation units for the test the same?  The test #includes <string.h>
> when __has_include (<string.h>) is true so making sure that behaves the same
> way would be my first step.  The warning is issued by the -Wrestrict pass so
> the -fdump-tree-wrestrict output would be the next thing to look at.

That seems odd for the -Wrestrict pass to emit -Warray-bounds warnings; I would
generally expect passes named for warnings to only emit warnings that share
that name...


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84774
[Bug 84774] [meta-bug] bogus/missing -Wrestrict
>From gcc-bugs-return-663945-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 04:18:22 2019
Return-Path: <gcc-bugs-return-663945-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 102120 invoked by alias); 23 Dec 2019 04:18:22 -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 96677 invoked by uid 48); 23 Dec 2019 04:18:18 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/47781] warnings from custom printf format specifiers
Date: Mon, 23 Dec 2019 04:18: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: 4.4.5
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: NEW
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-47781-4-08l8VXMMcT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-47781-4@http.gcc.gnu.org/bugzilla/>
References: <bug-47781-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02015.txt.bz2
Content-length: 477

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

--- Comment #21 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Cj Welborn from comment #20)
> Has anything changed since 2017 that would let me use
> register_printf_specifier and -Wformat warnings at the same time? 

Not that I know of; people still can't agree on a proper design AFAIK...
contributions welcome:
https://gcc.gnu.org/wiki/GettingStarted#Basics:_Contributing_to_GCC_in_10_easy_steps
>From gcc-bugs-return-663946-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 04:33:15 2019
Return-Path: <gcc-bugs-return-663946-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30949 invoked by alias); 23 Dec 2019 04:33:15 -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 30886 invoked by uid 48); 23 Dec 2019 04:33:11 -0000
From: "cjwelborn at live dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/47781] warnings from custom printf format specifiers
Date: Mon, 23 Dec 2019 04:33: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: 4.4.5
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: cjwelborn at live dot com
X-Bugzilla-Status: NEW
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-47781-4-1PsjqoMKiz@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-47781-4@http.gcc.gnu.org/bugzilla/>
References: <bug-47781-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02016.txt.bz2
Content-length: 216

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

--- Comment #22 from Cj Welborn <cjwelborn at live dot com> ---
Thank you for the reply. It's probably out of my league, but I might take a
look when I get time.
>From gcc-bugs-return-663947-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 04:51:15 2019
Return-Path: <gcc-bugs-return-663947-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 74978 invoked by alias); 23 Dec 2019 04:51:15 -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 74939 invoked by uid 48); 23 Dec 2019 04:51:11 -0000
From: "rjiejie at me dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/93045] New: gc bug with test "start_unit-test-1.c"
Date: Mon, 23 Dec 2019 04:51:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 8.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rjiejie at me dot com
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93045-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02017.txt.bz2
Content-length: 1150

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

            Bug ID: 93045
           Summary: gc bug with test "start_unit-test-1.c"
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rjiejie at me dot com
  Target Milestone: ---

/lhome/software/jojo/csky-toolchain-build-riscv/build-riscv64-linux-glibc-opt4mabi-lp64_march-rv64gc/gcc-riscv/build-gcc-linux-stage2/gcc/xgcc
-B/lhome/software/jojo/csky-toolchain-build-riscv/build-riscv64-linux-glibc-opt4mabi-lp64_march-rv64gc/gcc-riscv/build-gcc-linux-stage2/gcc/
/lhome/software/jojo/csky-toolchain-build-riscv/gcc-riscv/riscv-gcc/gcc/testsuite/gcc.dg/plugin/start_unit-test-1.c
-march=rv64gc -mabi=lp64 -mcmodel=medlow -fno-diagnostics-show-caret
-fdiagnostics-color=never -fplugin=./start_unit_plugin.so -O -S -o
start_unit-test-1.s
fake_var not INTEGER_TYPE
FAIL: gcc.dg/plugin/start_unit-test-1.c -fplugin=./start_unit_plugin.so (test
for excess errors)
Excess errors:
fake_var not INTEGER_TYPE
>From gcc-bugs-return-663948-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 05:03:03 2019
Return-Path: <gcc-bugs-return-663948-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 86302 invoked by alias); 23 Dec 2019 05:03:03 -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 86171 invoked by uid 48); 23 Dec 2019 05:02:59 -0000
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/92794] [10 Regression] ICE in decide_about_value, at ipa-cp.c:5186
Date: Mon, 23 Dec 2019 05:03:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ipa
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code, needs-bisection
X-Bugzilla-Severity: normal
X-Bugzilla-Who: asolokha at gmx dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: fxue at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-92794-4-LSVpyVrKQl@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92794-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92794-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02018.txt.bz2
Content-length: 436

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

Arseny Solokha <asolokha at gmx dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Arseny Solokha <asolokha at gmx dot com> ---
Fixed on the trunk.
>From gcc-bugs-return-663949-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 05:04:24 2019
Return-Path: <gcc-bugs-return-663949-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 87547 invoked by alias); 23 Dec 2019 05:04:24 -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 87469 invoked by uid 48); 23 Dec 2019 05:04:19 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/26190] combine misses some distributivity
Date: Mon, 23 Dec 2019 05:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.2.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P5
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-26190-4-iub8lhJ8sU@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-26190-4@http.gcc.gnu.org/bugzilla/>
References: <bug-26190-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02019.txt.bz2
Content-length: 187

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

--- Comment #8 from Eric Gallager <egallager at gcc dot gnu.org> ---
Does the new combine2 pass proposed for GCC 10 fix any of this?
>From gcc-bugs-return-663950-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 05:05:28 2019
Return-Path: <gcc-bugs-return-663950-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 88812 invoked by alias); 23 Dec 2019 05:05:28 -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 88695 invoked by uid 48); 23 Dec 2019 05:05:24 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/18395] [meta-bug] combine needs to be templatized like a peepholer
Date: Mon, 23 Dec 2019 05:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.0.0
X-Bugzilla-Keywords: meta-bug, missed-optimization
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-18395-4-RO41Xb7ZQ1@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-18395-4@http.gcc.gnu.org/bugzilla/>
References: <bug-18395-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02020.txt.bz2
Content-length: 199

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

--- Comment #4 from Eric Gallager <egallager at gcc dot gnu.org> ---
Does the new combine2 pass proposed for GCC 10 address any of these issues?
>From gcc-bugs-return-663951-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 05:08:41 2019
Return-Path: <gcc-bugs-return-663951-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 93034 invoked by alias); 23 Dec 2019 05:08:40 -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 92975 invoked by uid 48); 23 Dec 2019 05:08:37 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/53917] Wuninitialized warning points to place where variable doesn't occur
Date: Mon, 23 Dec 2019 05:08:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.6.3
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: NEW
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: cf_reconfirmed_on
Message-ID: <bug-53917-4-6NpnNJGWwl@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-53917-4@http.gcc.gnu.org/bugzilla/>
References: <bug-53917-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02021.txt.bz2
Content-length: 897

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2017-09-24 00:00:00         |2019-12-23

--- Comment #7 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #3)
> 
> gcc still gets this one wrong though:
> 
> $ /usr/local/bin/gcc -c -Os -S -Wall -Wextra 53917_a.c
> 53917_a.c: In function ‘fn4’:
> 53917_a.c:38:8: warning: ‘valid’ may be used uninitialized in this function
> [-Wmaybe-uninitialized]
>      if (fn3 (&p_t1_rw_fsm_data.tag_mem_config))
>         ^
> $
> 
> So confirmed for the second testcase.

Reconfirming that, despite improvements to location info in general, it's still
bad here.
>From gcc-bugs-return-663952-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 05:14:33 2019
Return-Path: <gcc-bugs-return-663952-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 128259 invoked by alias); 23 Dec 2019 05:14:32 -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 128169 invoked by uid 48); 23 Dec 2019 05:14:29 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/83336] [meta-bug] Issues with displaying inlining chain for middle-end warnings
Date: Mon, 23 Dec 2019 05:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 8.0
X-Bugzilla-Keywords: diagnostic, meta-bug
X-Bugzilla-Severity: normal
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: NEW
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: keywords cc dependson short_desc
Message-ID: <bug-83336-4-cYJqw1lPGr@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-83336-4@http.gcc.gnu.org/bugzilla/>
References: <bug-83336-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02022.txt.bz2
Content-length: 913

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

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |meta-bug
                 CC|                            |egallager at gcc dot gnu.org
         Depends on|                            |79872
            Summary|Issues with displaying      |[meta-bug] Issues with
                   |inlining chain for          |displaying inlining chain
                   |middle-end warnings         |for middle-end warnings

--- Comment #7 from Eric Gallager <egallager at gcc dot gnu.org> ---
making this a meta-bug and having it depend on bug 79872


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79872
[Bug 79872] document placeholder %K in gcc-internal-format
>From gcc-bugs-return-663953-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 05:23:07 2019
Return-Path: <gcc-bugs-return-663953-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 3220 invoked by alias); 23 Dec 2019 05:23:07 -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 3195 invoked by uid 48); 23 Dec 2019 05:23:03 -0000
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/92644] [9 Regression] ICE in wide_int_to_tree_1, at tree.c:1530
Date: Mon, 23 Dec 2019 05:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: asolokha at gmx dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 9.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-92644-4-Y4QIIhHvjn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92644-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92644-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02023.txt.bz2
Content-length: 189

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

--- Comment #9 from Arseny Solokha <asolokha at gmx dot com> ---
I believe, it can be closed now, as the gcc 8 branch is not affected?
>From gcc-bugs-return-663954-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 05:24:49 2019
Return-Path: <gcc-bugs-return-663954-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4783 invoked by alias); 23 Dec 2019 05:24:49 -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 4733 invoked by uid 48); 23 Dec 2019 05:24:46 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/91770] warn on #includes inside extern C regions
Date: Mon, 23 Dec 2019 05:24: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: 10.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: nathan at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-91770-4-PjMn4W0vR4@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91770-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91770-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02024.txt.bz2
Content-length: 273

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

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
I wonder how hard it would be to get the interaction with -Wsystem-headers
right here, given how many other issues with -Wsystem-headers there are...
>From gcc-bugs-return-663955-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 06:13:09 2019
Return-Path: <gcc-bugs-return-663955-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 44210 invoked by alias); 23 Dec 2019 06:13:09 -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 44159 invoked by uid 48); 23 Dec 2019 06:13:04 -0000
From: "egallager at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/91777] No warning for iterator going out of scope
Date: Mon, 23 Dec 2019 06:13: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: 9.1.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: normal
X-Bugzilla-Who: egallager at gcc dot gnu.org
X-Bugzilla-Status: WAITING
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-91777-4-KQo0FK6ZrY@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-91777-4@http.gcc.gnu.org/bugzilla/>
References: <bug-91777-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02025.txt.bz2
Content-length: 1411

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

--- Comment #8 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #7)
> It's also diagnosed by libstdc++ Debug Mode:
> 
> /home/jwakely/gcc/10/include/c++/10.0.0/debug/safe_iterator.h:294:
> In function:
>     __gnu_debug::_Safe_iterator<_Iterator, _Sequence, _Category>::reference 
>     __gnu_debug::_Safe_iterator<_Iterator, _Sequence, 
>     _Category>::operator*() const [with _Iterator = 
>     std::__cxx1998::_List_const_iterator<int>; _Sequence = 
>     std::__debug::list<int>; _Category = std::forward_iterator_tag; 
>     __gnu_debug::_Safe_iterator<_Iterator, _Sequence, _Category>::reference 
>     = const int&]
> 
> Error: attempt to dereference a singular iterator.
> 
> Objects involved in the operation:
>     iterator "this" @ 0x0x7ffffb1db7f0 {
>       type = std::__cxx1998::_List_const_iterator<int> (constant iterator);
>       state = singular;
>     }
> Aborted (core dumped)
> 
> 
> I don't think it's feasible to warn about this. As far as the compiler
> knows, the iterator is just a value type. It's not practical to expect the
> compiler to track that it contains a pointer to a node that is about to be
> destroyed by a container going out of scope.

Maybe not in the compiler proper; could be material for someone to write a
plugin for...
>From gcc-bugs-return-663956-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 07:14:11 2019
Return-Path: <gcc-bugs-return-663956-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 56887 invoked by alias); 23 Dec 2019 07:14:11 -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 56853 invoked by uid 48); 23 Dec 2019 07:14:06 -0000
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93046] New: [10 Regression] ICE in cp_gimplify_init_expr
Date: Mon, 23 Dec 2019 07:14:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: asolokha at gmx dot com
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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93046-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02026.txt.bz2
Content-length: 4341

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

            Bug ID: 93046
           Summary: [10 Regression] ICE in cp_gimplify_init_expr
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-10.0.0-alpha20191222 snapshot (r279712) ICEs when compiling the following
testcase, reduced from clang/testsuite/CodeGenCXX/cxx1z-copy-omission.cpp (and
several others) from the clang 9.0.1 test suite:

struct id {
  id (int);
  operator bool ();
};

id
o9 ()
{
  return id (1) ?: id (2);
}

% g++-10.0.0-alpha20191222 -c fxrshtnj.cpp
fxrshtnj.cpp: In function 'id o9()':
fxrshtnj.cpp:9:25: internal compiler error: Segmentation fault
    9 |   return id (1) ?: id (2);
      |                         ^
0xf529d0 crash_signal
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/toplev.c:328
0x8939d8 cp_gimplify_init_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cp/cp-gimplify.c:531
0x8939d8 cp_gimplify_expr(tree_node**, gimple**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cp/cp-gimplify.c:734
0xccb881 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:13475
0xccfdf5 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:6814
0xce205d gimplify_cond_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:4232
0xcccdb6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:13523
0xccfdf5 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:6814
0xcd7815 gimplify_and_add(tree_node*, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:486
0xcd7815 gimplify_return_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:1659
0xccd4a9 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:13827
0xce5243 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:6814
0xce5243 gimplify_cleanup_point_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:6556
0xccc7c7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:13958
0xce47a4 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:6814
0xce47a4 gimplify_body(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:14814
0xce4bec gimplify_function_tree(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/gimplify.c:14958
0xb350f2 cgraph_node::analyze()
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cgraphunit.c:669
0xb379ee analyze_functions
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cgraphunit.c:1212
0xb385e8 symbol_table::finalize_compilation_unit()
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191222/work/gcc-10-20191222/gcc/cgraphunit.c:2958

r279576 seems to be a possible culprit.
>From gcc-bugs-return-663957-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 08:12:07 2019
Return-Path: <gcc-bugs-return-663957-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 107811 invoked by alias); 23 Dec 2019 08:12:06 -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 85892 invoked by uid 48); 23 Dec 2019 08:11:56 -0000
From: "fxue at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/93041] GCC 10 removes an infinite loop and causes a null pointer to dereferenced
Date: Mon, 23 Dec 2019 08:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: fxue 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: cc
Message-ID: <bug-93041-4-AGj6o2w3qi@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93041-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93041-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02027.txt.bz2
Content-length: 599

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

fxue at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxue at gcc dot gnu.org

--- Comment #3 from fxue at gcc dot gnu.org ---
For gcc10, by default, a loop containing an exit, although it might not be a
real exit, is considered as finite, which is controlled by a newly introduced
option -finite-loops. To be compatible with old behavior, you can explicitly
add -fno-finite-loops.
>From gcc-bugs-return-663958-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 08:18:45 2019
Return-Path: <gcc-bugs-return-663958-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10722 invoked by alias); 23 Dec 2019 08:18:45 -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 10695 invoked by uid 48); 23 Dec 2019 08:18:41 -0000
From: "guojiufu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/93047] New: frename-registers does not work well with __builtin_return
Date: Mon, 23 Dec 2019 08:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: guojiufu 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93047-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02028.txt.bz2
Content-length: 2200

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

            Bug ID: 93047
           Summary: frename-registers does not work well with
                    __builtin_return
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: guojiufu at gcc dot gnu.org
  Target Milestone: ---

There is a case builtin-return-1.c which is checking __builtin_return and
__builtin_apply. Which this case fail with -frename-registers. 
It seems rnreg rename a register to 'return register' after function call.

gcc $GCC_SRC/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c -O3
-frename-registers -o ./builtin-return-1.exe

./builtin-return-1.exe
Aborted (core dumped)

[Tested on powerpc64le.]

Dump asm code, there is code like:

        bl foo
        addi 3,31,128 #this line is using r3 which should be return reg of
previous call foo
        addi 12,31,304
        addi 10,31,336
        addi 6,31,352
        xxpermdi 0,1,1,2
        xxpermdi 9,35,35,2
        std 3,96(31) #here r3 (return value of foo) is saved

Without -frename-registers
        bl foo
        addi 0,31,128
        addi 11,31,240
        addi 4,31,256
        addi 5,31,272
        std 3,96(31) #here
        xxpermdi 1,1,1,2
        xxpermdi 2,2,2,2

rnreg should not rename r0 for instruction "addi 0,31,128" to r3.
r3 should not be used as 'rename source register' after "bl xx" untill "std
3,..."

source code:
#ifdef __MMIX__
/* No parameters on stack for bar.  */
#define STACK_ARGUMENTS_SIZE 0
#else
#define STACK_ARGUMENTS_SIZE 64
#endif

extern void abort(void);

int foo(int n)
{
  return n+1;
}

int bar(int n)
{
  __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(),
                                   STACK_ARGUMENTS_SIZE));
}

int main(void)
{
  /* Allocate 64 bytes on the stack to make sure that __builtin_apply           
     can read at least 64 bytes above the return address.  */
  char dummy[64];

  __asm__ ("" : : "" (dummy));

  if (bar(1) != 2)
    abort();

  return 0;
}
>From gcc-bugs-return-663959-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 08:37:37 2019
Return-Path: <gcc-bugs-return-663959-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 70974 invoked by alias); 23 Dec 2019 08:37:37 -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 70903 invoked by uid 48); 23 Dec 2019 08:37:32 -0000
From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/90677] [9 Regression] gcc-9.1.0 fails to build __gcc_diag__ souce: error: 'cgraph_node' is not defined as a type
Date: Mon, 23 Dec 2019 08:37: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: 9.1.0
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ebotcazou at gcc dot gnu.org
X-Bugzilla-Status: REOPENED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P2
X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 9.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cc resolution
Message-ID: <bug-90677-4-amOPQozafj@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-90677-4@http.gcc.gnu.org/bugzilla/>
References: <bug-90677-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02029.txt.bz2
Content-length: 857

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |ebotcazou at gcc dot gnu.org
         Resolution|FIXED                       |---

--- Comment #14 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
The fix breaks the build of earlier GCCs with the C++ compiler:

extern void foo (int, int, const char *, ...)
  __attribute__ ((__format__ (__gcc_tdiag__, 3, 4)));
struct cgraph_node;
extern void bar (struct cgraph_node *);

t.cpp:2:52: error: 'cgraph_node' is not defined as a type
    2 |   __attribute__ ((__format__ (__gcc_tdiag__, 3, 4)));
      |
>From gcc-bugs-return-663960-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 09:23:04 2019
Return-Path: <gcc-bugs-return-663960-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 53640 invoked by alias); 23 Dec 2019 09:23:03 -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 53593 invoked by uid 48); 23 Dec 2019 09:22:59 -0000
From: "pilarlatiesa at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93048] New: ICE in verify_gimple
Date: Mon, 23 Dec 2019 09:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pilarlatiesa at gmail dot com
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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02030.txt.bz2
Content-length: 3701

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

            Bug ID: 93048
           Summary: ICE in verify_gimple
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pilarlatiesa at gmail dot com
  Target Milestone: ---

The (valid) code bellow trigger an ICE:

  In member function 'TCoefs<d, r> TExprDiv<d, r, T<d, 1, TRest ...>
>::CalcCoefs(std::size_t) const [with long unsigned int d = 2; long unsigned
int r = 1; TRest = {}; T = TCampo]':

  <source>:79:1: error: incorrect sharing of tree nodes

     79 | TExprDiv<d, r, T<d, 1u, TRest...>>::CalcCoefs(std::size_t) const

        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  *<retval>

  <retval>->aP = aP;

  during GIMPLE pass: cfg

  <source>:79:1: internal compiler error: verify_gimple failed

Started ICEing with 10.0.0 20191222 (x86_64-pc-linux-gnu). It compiled fine
with 10.0.0 20191126.

I could not reduce the testcase any further. Sorry.

  #include <cstddef>
  #include <valarray>

  template<std::size_t d, std::size_t r1>
  struct TTensor
  {};

  template<std::size_t d, std::size_t r>
  struct TCoefs
  {
    double aP;
    std::valarray<double> aF;
    TTensor<d, r> b;
  };

  template<typename T>
  class TExprBase {};

  template<std::size_t d, std::size_t r1, typename... TRest, 
           template<std::size_t, std::size_t, typename...> typename T>
  class TExprBase<T<d, r1, TRest...>>
  {
  public:
    decltype(auto)
    CalcCoefs(std::size_t i) const
      { return static_cast<T<d, r1, TRest...> const *>(this)->CalcCoefs(i); }

    operator T<d, r1, TRest...> const &() const
      { return static_cast<T<d, r1, TRest...> const &>(*this); }
  };

  template<std::size_t d, std::size_t r, typename T, typename U, typename TOp>
  class TBinExpr: public TExprBase<TBinExpr<d, r, T, U, TOp>>
  {
  private:
    T const &lhs;
    U const &rhs;
    [[no_unique_address]] TOp const Op = {};

  public:
    TBinExpr() = delete;

    TBinExpr(T const &lhs_, U const &rhs_) :
      lhs(lhs_), rhs(rhs_) {}

    decltype(auto)
    CalcCoefs(std::size_t i) const
      { return Op(lhs.CalcCoefs(i), rhs.CalcCoefs(i)); }
  };

  template<std::size_t d, std::size_t r>
  class TCampo : public TExprBase<TCampo<d, r>> {};

  template<std::size_t d, std::size_t r, typename T = void>
  class TExprDiv {};

  template<std::size_t d, std::size_t r, typename... TRest, 
           template<std::size_t, std::size_t, typename...> typename T>
  class TExprDiv<d, r, T<d, 1u, TRest...>> : public TExprBase<TExprDiv<d, r,
T<d, 1u, TRest...>>>
  {
  private:
    TCampo<d, r> const &U;
    TCampo<d, r> const &φ;

  public:
      TExprDiv(TExprBase<T<d, 1u, TRest...>> const &U_, TCampo<d, r> const
&φ_):
         U(U_), φ(φ_) {}

    TCoefs<d, r>
    CalcCoefs(std::size_t) const;
  };

  template<std::size_t d, std::size_t r, typename... TRest, 
           template<std::size_t, std::size_t, typename...> typename T>
  TCoefs<d, r>
  TExprDiv<d, r, T<d, 1u, TRest...>>::CalcCoefs(std::size_t) const
  {
  double aP = 0.0;
  std::valarray<double> aF;
  TTensor<d, r> b = {};

  return {aP, aF, b};
  }

  template<std::size_t d, std::size_t r, typename... TRest, 
           template<std::size_t, std::size_t, typename...> typename T>
  TExprDiv<d, r, T<d, 1u, TRest...>>
  div(TExprBase<T<d, 1u, TRest...>> const &U, TCampo<d, r> const &φ)
    { return {U, φ}; }

  int main()
  {
  TCampo<2u, 1u> U;

  auto bar = div(U, U).CalcCoefs(0);

  return 0;
  }
>From gcc-bugs-return-663961-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 09:44:26 2019
Return-Path: <gcc-bugs-return-663961-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 128755 invoked by alias); 23 Dec 2019 09:44:25 -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 128690 invoked by uid 55); 23 Dec 2019 09:44:19 -0000
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/92789] Non-obvious ?: behaviour with structurally equivalent types
Date: Mon, 23 Dec 2019 09:44: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: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rsandifo 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-92789-4-1J4jbV4DIu@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92789-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92789-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02031.txt.bz2
Content-length: 2093

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

--- Comment #1 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
Author: rsandifo
Date: Mon Dec 23 09:43:46 2019
New Revision: 279717

URL: https://gcc.gnu.org/viewcvs?rev=279717&root=gcc&view=rev
Log:
[C++] Make same_type_p return false for gnu_vector_type_p differences (PR
92789)

As Jason pointed out in the review of the C++ gnu_vector_type_p patch:

    https://gcc.gnu.org/ml/gcc-patches/2019-12/msg00173.html

the real fix for the XFAILs in acle/general-c++/gnu_vectors_*.C is to
make same_type_p return false for two types if one is gnu_vector_type_p
and the other isn't.  This patch does that and fixes the fallout.

Originally I'd tried to make it so that "X *" and "Y *" are
interconvertible whenever X and Y are, and similarly for
"X &" and "Y &".  That doesn't fall out naturally though,
and is different from how -flax-vector-conversions works.
The patch therefore accepts all the consequences of making
X and Y !same_type_p instead of trying to work around them.

2019-12-23  Richard Sandiford  <richard.sandiford@arm.com>

gcc/cp/
        PR c++/92789
        * typeck.c (structural_comptypes): Make sure that two vector types
        agree on gnu_vector_type_p.

gcc/testsuite/
        PR c++/92789
        * g++.dg/ext/sve-sizeless-2.C (statements): Expect pointer
        difference and comparisons between GNU and non-GNU types
        to be rejected.  Expect __is_same to be false for such pairs.
        * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C: Remove
        XFAILs.  Expect conversions between SVE vector pointers and
        GNU vector pointers to be rejected.  Test references.
        * g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C: Likewise.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/typeck.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/ext/sve-sizeless-2.C
    trunk/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_1.C
    trunk/gcc/testsuite/g++.target/aarch64/sve/acle/general-c++/gnu_vectors_2.C
>From gcc-bugs-return-663962-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 09:46:30 2019
Return-Path: <gcc-bugs-return-663962-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 130675 invoked by alias); 23 Dec 2019 09:46:29 -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 130647 invoked by uid 48); 23 Dec 2019 09:46:25 -0000
From: "svante.signell at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/93049] New: limits.h generated by fixincludes breaks cross-compilation
Date: Mon, 23 Dec 2019 09:46:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: other
X-Bugzilla-Version: 9.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: svante.signell at gmail dot com
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created
Message-ID: <bug-93049-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02032.txt.bz2
Content-length: 1205

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

            Bug ID: 93049
           Summary: limits.h generated by fixincludes breaks
                    cross-compilation
           Product: gcc
           Version: 9.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: svante.signell at gmail dot com
  Target Milestone: ---

Created attachment 47542
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47542&action=edit
fix for glimits.h

Hello,

Cross-compiling from x86_64-linux-gnu to i686-gnu breaks for example the builds
of
sed-4.7 and coreutils-8.31, as well as Linux-PAM-1.3.1. The first two failures
are due to that the fixed limits.h #define MB_LEN_MAX 1 while the system one
has #define MB_LEN_MAX 16. The third error is due to that

#ifdef __USE_POSIX2
# include <bits/posix2_lim.h>
#endif

is chopped off the generated limits.h, leaving LINE_MAX undefined.

The problem seems to be in the file gcc-9.2.0/gcc/glimits.h causing the
generated gcc-9.2.0.obj/gcc/include-fixed/limits.h.

The attached patch fixinc_glimits.h.diff fixes that problem.
>From gcc-bugs-return-663963-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 09:56:11 2019
Return-Path: <gcc-bugs-return-663963-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 9552 invoked by alias); 23 Dec 2019 09:56:11 -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 9508 invoked by uid 48); 23 Dec 2019 09:56:06 -0000
From: "pilarlatiesa at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93048] ICE in verify_gimple
Date: Mon, 23 Dec 2019 09:56: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: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pilarlatiesa at gmail dot com
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-93048-4-ml5SkZUw5o@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02033.txt.bz2
Content-length: 1098

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

--- Comment #1 from Pilar Latiesa <pilarlatiesa at gmail dot com> ---
Reduced:

  #include <valarray>

  template<typename T>
  class valarray {};

  template<int d, int r1>
  struct TTensor
  {};

  template<int d, int r>
  struct TCoefs
  {
    double aP;
    std::valarray<double> aF;
    TTensor<d, r> b;
  };

  template<int d, int r>
  class TCampo {};

  template<int d, int r>
  class TExprDiv
  {
  private:
    TCampo<d, r> const &U;
    TCampo<d, r> const &fi;

  public:
    TExprDiv(TCampo<d, r> const &U_, TCampo<d, r> const &fi_):
      U(U_), fi(fi_) {}

    TCoefs<d, r>
    CalcCoefs(int) const;
  };

  template<int d, int r>
  TCoefs<d, r>
  TExprDiv<d, r>::CalcCoefs(int) const
  {
  double aP = 0.0;
  std::valarray<double> aF;
  TTensor<d, r> b = {};

  return {aP, aF, b};
  }

  int main()
  {
  TCampo<2u, 1u> U;
  auto bar = TExprDiv<2u, 1u>(U, U).CalcCoefs(0);

  return 0;
  }

I could not remove the dependency on the valarray header. It seems that TCoefs
needs to have this members for the ICE to happen.
>From gcc-bugs-return-663964-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 10:00:48 2019
Return-Path: <gcc-bugs-return-663964-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 112766 invoked by alias); 23 Dec 2019 10:00:48 -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 112299 invoked by uid 48); 23 Dec 2019 10:00:15 -0000
From: "pilarlatiesa at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93048] ICE in verify_gimple
Date: Mon, 23 Dec 2019 10:00: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: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pilarlatiesa at gmail dot com
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-93048-4-hyxYYoHfoE@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02034.txt.bz2
Content-length: 651

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

--- Comment #2 from Pilar Latiesa <pilarlatiesa at gmail dot com> ---
Even more reduced:

  #include <valarray>

  template<int d, int r1>
  struct TTensor {};

  template<int d, int r>
  struct TCoefs
  {
    double aP;
    std::valarray<double> aF;
    TTensor<d, r> b;
  };

  template<int d, int r>
  class TExprDiv
  {
  public:
    TCoefs<d, r>
    CalcCoefs(int) const;
  };

  template<int d, int r>
  TCoefs<d, r>
  TExprDiv<d, r>::CalcCoefs(int) const
  {
  double aP = 0.0;
  return {aP, {}, {}};
  }

  int main()
  {
  auto bar = TExprDiv<2u, 1u>().CalcCoefs(0);

  return 0;
  }
>From gcc-bugs-return-663965-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 10:03:19 2019
Return-Path: <gcc-bugs-return-663965-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 115004 invoked by alias); 23 Dec 2019 10:03:19 -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 114933 invoked by uid 48); 23 Dec 2019 10:03:15 -0000
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93048] ICE in verify_gimple
Date: Mon, 23 Dec 2019 10:03: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: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: asolokha at gmx dot com
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: cc
Message-ID: <bug-93048-4-7IlHPKeksX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02035.txt.bz2
Content-length: 413

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

Arseny Solokha <asolokha at gmx dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asolokha at gmx dot com

--- Comment #3 from Arseny Solokha <asolokha at gmx dot com> ---
It is likely a duplicate of PR93033.
>From gcc-bugs-return-663966-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 10:10:02 2019
Return-Path: <gcc-bugs-return-663966-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4992 invoked by alias); 23 Dec 2019 10:10:01 -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 4904 invoked by uid 48); 23 Dec 2019 10:09:57 -0000
From: "schwab@linux-m68k.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/93049] limits.h generated by fixincludes breaks cross-compilation
Date: Mon, 23 Dec 2019 10:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: other
X-Bugzilla-Version: 9.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: schwab@linux-m68k.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-93049-4-JEHAfbLSBS@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93049-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93049-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02036.txt.bz2
Content-length: 214

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

--- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
Make sure you have sysroot properly set up so that the gcc Makefile finds the
system limits.h.
>From gcc-bugs-return-663967-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 10:42:41 2019
Return-Path: <gcc-bugs-return-663967-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 34320 invoked by alias); 23 Dec 2019 10:42:41 -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 34247 invoked by uid 48); 23 Dec 2019 10:42:37 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/92644] [9 Regression] ICE in wide_int_to_tree_1, at tree.c:1530
Date: Mon, 23 Dec 2019 10:42:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 9.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-92644-4-CngjowgvoU@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92644-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92644-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02037.txt.bz2
Content-length: 421

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
.
>From gcc-bugs-return-663968-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 10:43:35 2019
Return-Path: <gcc-bugs-return-663968-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 35470 invoked by alias); 23 Dec 2019 10:43:35 -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 35431 invoked by uid 48); 23 Dec 2019 10:43:30 -0000
From: "pilarlatiesa at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93048] ICE in verify_gimple
Date: Mon, 23 Dec 2019 10:43: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: 10.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pilarlatiesa at gmail dot com
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-93048-4-9IHYXPBo9f@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93048-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02038.txt.bz2
Content-length: 552

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

--- Comment #4 from Pilar Latiesa <pilarlatiesa at gmail dot com> ---
Minimal testcase ;-)

  #include <valarray>

  struct TTensor {};

  struct TCoefs
  {
    double aP;
    std::valarray<double> aF;
    TTensor b;
  };

  TCoefs CalcCoefs()
  {
  double aP = 0.0;
  return {aP, {}, {}};
  }

I still don't understand why one of the members must be std::valarray. With a
contrived valarray class with the same constructors and noexcept qualifiers as
the std version the code compiles fine.
>From gcc-bugs-return-663969-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 12:13:16 2019
Return-Path: <gcc-bugs-return-663969-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 36840 invoked by alias); 23 Dec 2019 12:13:16 -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 36799 invoked by uid 48); 23 Dec 2019 12:13:11 -0000
From: "db0451 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/93050] New: throw within constructor initialisation list causes invalid free in destructor
Date: Mon, 23 Dec 2019 12:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: db0451 at gmail dot com
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93050-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02039.txt.bz2
Content-length: 2789

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

            Bug ID: 93050
           Summary: throw within constructor initialisation list causes
                    invalid free in destructor
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: db0451 at gmail dot com
  Target Milestone: ---

I've come across this error at least twice when trying to throw from
constructor initialisation lists, so I don't *think* I'm uniquely at fault
here...

All I want to do is move/copy an argument into a member if suitable, and throw
if not, while not having to use the constructor body, instead the ctor
init-list

The below code, compiled with...

* g++ --version: `g++.exe (Rev2, Built by MSYS2 project) 9.2.0`
* compiler args: `g++ -std=c++17 -Wall -Wextra -Wpedantic test.cpp`

...correctly throws when Test() is called with an empty string, but with a
non-empty string is crashes in free() via ~Test().

source:

```cpp
#include <stdexcept>
#include <string>

struct Test final {
        std::string m_string;

        Test(std::string string)
        : m_string{ !string.empty() ? std::move(string)
                    : throw std::invalid_argument{"string cannot be empty"} }
        {}
};

auto
main() -> int
{
        auto test = Test{"2"};
        return 0;
}
```

gdb log, run on 

```
Reading symbols from ./a.exe...done.
(gdb) run
Starting program: /tmp/Atm/build/a.exe
[New Thread 3880.0x3c38]
[New Thread 3880.0x2b68]
[New Thread 3880.0x5624]
[New Thread 3880.0x4a14]
warning: Critical error detected c0000374

Thread 1 received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffdca4391f3 in ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed () from
/c/WINDOWS/SYSTEM32/ntdll.dll
(gdb) bt
#0  0x00007ffdca4391f3 in ntdll!RtlIsNonEmptyDirectoryReparsePointAllowed ()
from /c/WINDOWS/SYSTEM32/ntdll.dll
#1  0x00007ffdca441622 in ntdll!RtlpNtMakeTemporaryKey () from
/c/WINDOWS/SYSTEM32/ntdll.dll
#2  0x00007ffdca44192a in ntdll!RtlpNtMakeTemporaryKey () from
/c/WINDOWS/SYSTEM32/ntdll.dll
#3  0x00007ffdca44a8e9 in ntdll!RtlpNtMakeTemporaryKey () from
/c/WINDOWS/SYSTEM32/ntdll.dll
#4  0x00007ffdca38088d in ntdll!RtlGetCurrentServiceSessionId () from
/c/WINDOWS/SYSTEM32/ntdll.dll
#5  0x00007ffdca37fc11 in ntdll!RtlFreeHeap () from
/c/WINDOWS/SYSTEM32/ntdll.dll
#6  0x00007ffdc8fd9cfc in msvcrt!free () from /c/WINDOWS/System32/msvcrt.dll
#7  0x0000000000402ef8 in Test::~Test() ()
#8  0x00000000004015d2 in main ()
(gdb)
```

Copying instead of `std::move()`ing the `string` doesn't seem to change
anything

Moving the check/throw into the constructor body works but shouldn't be needed.
>From gcc-bugs-return-663970-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 12:57:38 2019
Return-Path: <gcc-bugs-return-663970-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 107214 invoked by alias); 23 Dec 2019 12:57:36 -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 107172 invoked by uid 48); 23 Dec 2019 12:57:31 -0000
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/92961] [8/9/10 Regression] ICE in gfc_zero_size_array, at fortran/arith.c:1680
Date: Mon, 23 Dec 2019 12:57:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tkoenig at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: tkoenig at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc assigned_to everconfirmed
Message-ID: <bug-92961-4-VdmwviPmao@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-92961-4@http.gcc.gnu.org/bugzilla/>
References: <bug-92961-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02040.txt.bz2
Content-length: 569

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2019-12-23
                 CC|                            |tkoenig at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |tkoenig at gcc dot gnu.org
     Ever confirmed|0                           |1
>From gcc-bugs-return-663971-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 12:59:42 2019
Return-Path: <gcc-bugs-return-663971-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 108954 invoked by alias); 23 Dec 2019 12:59:40 -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 108925 invoked by uid 48); 23 Dec 2019 12:59:35 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93051] New: Wrong optimizations for pointers: `if (p == q) use p` -> `if (p == q) use q`
Date: Mon, 23 Dec 2019 12:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93051-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02041.txt.bz2
Content-length: 3086

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

            Bug ID: 93051
           Summary: Wrong optimizations for pointers: `if (p == q) use p`
                    -> `if (p == q) use q`
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ch3root at openwall dot com
  Target Milestone: ---

The optimizer sometimes changes `if (p == q) use p` to `if (p == q) use q` if
it can track the provenance of `q` but not of `p`. This is wrong when the
actual provenance of `p` differs from that of `q`.

Examples demonstrate the problem in different cases:
- with integers and with live pointers (to show that the problem is not in
casts to integers);
- with past-the-end pointers and without them (to show that even changing the
standard to make their comparisons UB will not help);
- with two allocations and with only one (to show that it's not related to how
memory is allocated by the compiler/libc).
Plus, all examples behaves quite well:
- respect provenance of pointers including via casts to integers (so this bug
is not about (im)possibility to clear provenance by casts to integers or
something);
- use only one comparison (so the question of its stability is not touched).

There is some previous analysis of propagation of conditional equivalences in
other bugs, e.g., pr65752#c52, pr61502#c25.

Somewhat more general clang bug -- https://bugs.llvm.org/show_bug.cgi?id=44313.
Previous lengthy discussion is in https://bugs.llvm.org/show_bug.cgi?id=34548.

Example with a past-the-end pointer (the wrong optimization seems to be applied
in vrp1):

----------------------------------------------------------------------
#include <stdio.h>

__attribute__((noipa,optnone)) // imagine it in a separate TU
static void *opaque(void *p) { return p; }

int main()
{
    int x[5];
    int y[1];

    int *p = x;
    int *q = y + 1;

    int *r = opaque(p); // hide provenance of p
    if (r == q) {
        *p = 1;
        *r = 2;
        printf("result: %d\n", *p);
    }

    opaque(q);
}
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes test.c && ./a.out
result: 2
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes -O3 test.c && ./a.out
test.c: In function ‘main’:
test.c:17:9: warning: array subscript 1 is outside array bounds of ‘int[1]’
[-Warray-bounds]
   17 |         *r = 2;
      |         ^~
test.c:9:9: note: while referencing ‘y’
    9 |     int y[1];
      |         ^
result: 1
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.0 20191223 (experimental)
----------------------------------------------------------------------

The warning nicely illustrates the problem:-)

Based on the example from Harald van Dijk in pr61502#c4.
>From gcc-bugs-return-663972-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 13:00:40 2019
Return-Path: <gcc-bugs-return-663972-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 110348 invoked by alias); 23 Dec 2019 13:00:40 -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 110237 invoked by uid 48); 23 Dec 2019 13:00:34 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93051] Wrong optimizations for pointers: `if (p == q) use p` -> `if (p == q) use q`
Date: Mon, 23 Dec 2019 13:00:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
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-93051-4-PocDwSGtH3@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93051-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93051-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02042.txt.bz2
Content-length: 1861

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

--- Comment #1 from Alexander Cherepanov <ch3root at openwall dot com> ---
Example with a restricted pointer (dom2):

----------------------------------------------------------------------
#include <stdio.h>

__attribute__((noipa,optnone)) // imagine it in a separate TU
static void *opaque(void *p) { return p; }

__attribute__((noipa)) // imagine it in a separate TU
static void f(int *restrict p, int *restrict q)
{
    int *r = opaque(p); // hide provenance of p
    if (r == q) {
        *p = 1;
        *r = 2;
        printf("result: %d\n", *p);
    }

    opaque(q);
}

int main()
{
    int x;
    f(&x, &x);
}
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes test.c && ./a.out
test.c: In function ‘main’:
test.c:22:7: warning: passing argument 1 to ‘restrict’-qualified parameter
aliases with argument 2 [-Wrestrict]
   22 |     f(&x, &x);
      |       ^~  ~~
result: 2
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes -O3 test.c && ./a.out
test.c: In function ‘main’:
test.c:22:7: warning: passing argument 1 to ‘restrict’-qualified parameter
aliases with argument 2 [-Wrestrict]
   22 |     f(&x, &x);
      |       ^~  ~~
result: 1
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.0 20191223 (experimental)
----------------------------------------------------------------------

Strictly speaking this example is not about provenance (both pointers have the
same provenance) but, for the optimizer, different restricted pointers probably
play similar roles.

Despite the warning, equal restricted pointers are fine per se -- see, e.g.,
Example 3 in C11, 6.7.3.1p10.
>From gcc-bugs-return-663973-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 13:01:23 2019
Return-Path: <gcc-bugs-return-663973-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 114970 invoked by alias); 23 Dec 2019 13:01:23 -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 111413 invoked by uid 48); 23 Dec 2019 13:01:16 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93051] Wrong optimizations for pointers: `if (p == q) use p` -> `if (p == q) use q`
Date: Mon, 23 Dec 2019 13:01:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
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-93051-4-8tALJ4Bp0c@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93051-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93051-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02043.txt.bz2
Content-length: 1194

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

--- Comment #2 from Alexander Cherepanov <ch3root at openwall dot com> ---
Example with a dead malloc (not in tree-opt):

----------------------------------------------------------------------
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

__attribute__((noipa,optnone)) // imagine it in a separate TU
static void *opaque(void *p) { return p; }

int main()
{
    int *q = malloc(sizeof(int));
    uintptr_t iq = (uintptr_t)(void *)q;
    free(q);

    int *p = malloc(sizeof(int));

    uintptr_t ir = (uintptr_t)(void *)opaque(p); // hide provenance of p

    if (ir == iq) {
        *p = 1;
        *(int *)ir = 2;
        printf("result: %d\n", *p);
    }
}
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes test.c && ./a.out
result: 2
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes -O3 test.c && ./a.out
result: 1
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.0 20191223 (experimental)
----------------------------------------------------------------------
>From gcc-bugs-return-663975-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 13:10:59 2019
Return-Path: <gcc-bugs-return-663975-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16987 invoked by alias); 23 Dec 2019 13:10:59 -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 16932 invoked by uid 48); 23 Dec 2019 13:10:54 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93052] Wrong optimizations for pointers: `p == q ? p : q` -> `q`
Date: Mon, 23 Dec 2019 13:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
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-93052-4-PyCs2TonYv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93052-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93052-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02045.txt.bz2
Content-length: 1668

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

--- Comment #1 from Alexander Cherepanov <ch3root at openwall dot com> ---
Example with a past-the-end pointer (vrp1, similar to but 93051, comment 0 but
this time with PHI):

----------------------------------------------------------------------
#include <stdio.h>

__attribute__((noipa,optnone)) // imagine it in a separate TU
static void *opaque(void *p) { return p; }

static int been_there = 0;

static int *f(int *p, int *q)
{
    if (p == q) {
        been_there = 1;
        return p;
    } else {
        been_there = 0;
        return q;
    }
}

int main()
{
    int x[5];
    int y[1];

    int *p = x;
    int *q = y + 1;
    opaque(q);

    int *p1 = opaque(p); // prevents early optimization of x==y+1
    int *r = f(p1, q);

    if (been_there) {
        *p = 1;
        *r = 2;
        printf("result: %d\n", *p);
    }
}
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes test.c && ./a.out
result: 2
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes -O3 test.c && ./a.out
test.c: In function ‘main’:
test.c:33:9: warning: array subscript 1 is outside array bounds of ‘int[1]’
[-Warray-bounds]
   33 |         *r = 2;
      |         ^~
test.c:22:9: note: while referencing ‘y’
   22 |     int y[1];
      |         ^
result: 1
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.0 20191223 (experimental)
----------------------------------------------------------------------
>From gcc-bugs-return-663974-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 13:10:21 2019
Return-Path: <gcc-bugs-return-663974-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13570 invoked by alias); 23 Dec 2019 13:10:20 -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 13522 invoked by uid 48); 23 Dec 2019 13:10:16 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93052] New: Wrong optimizations for pointers: `p == q ? p : q` -> `q`
Date: Mon, 23 Dec 2019 13:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93052-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02044.txt.bz2
Content-length: 2264

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

            Bug ID: 93052
           Summary: Wrong optimizations for pointers: `p == q ? p : q` ->
                    `q`
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ch3root at openwall dot com
  Target Milestone: ---

Similar to pr93051.

The optimizer sometimes changes `p == q ? p : q` to `q`. This is wrong when the
actual provenance of `p` differs from that of `q`.
There are two forms -- with the actual conditional operator and with the `if`
statement.

The ideal example would be constructed with the help of restricted pointers but
it's run into a theoretical problem -- see the first testcase in pr92963.
My other examples require two conditionals to eliminate the possibility of UB.
Comparison of integers should give stable results, hopefully that would be
enough to demonstrate the problem.

Example with the conditional operator and with dead malloc (the wrong
optimization seems to be applied before tree-opt):

----------------------------------------------------------------------
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

__attribute__((noipa,optnone)) // imagine it in a separate TU
static void *opaque(void *p) { return p; }

int main()
{
    int *q = malloc(sizeof(int));
    opaque(q);
    uintptr_t iq = (uintptr_t)(void *)q;
    free(q);

    int *p = malloc(sizeof(int));
    opaque(p);
    uintptr_t ip = (uintptr_t)(void *)p;

    uintptr_t ir = ip == iq ? ip : iq;
    if (ip == iq) {
        *p = 1;
        *(int *)(void *)ir = 2;
        printf("result: %d\n", *p);
    }
}
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes test.c && ./a.out
result: 2
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes -O3 test.c && ./a.out
result: 1
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.0 20191223 (experimental)
----------------------------------------------------------------------
>From gcc-bugs-return-663976-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 13:11:36 2019
Return-Path: <gcc-bugs-return-663976-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17847 invoked by alias); 23 Dec 2019 13:11:36 -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 17800 invoked by uid 48); 23 Dec 2019 13:11:32 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93052] Wrong optimizations for pointers: `p == q ? p : q` -> `q`
Date: Mon, 23 Dec 2019 13:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
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-93052-4-FqkDTgFZx3@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93052-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93052-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02046.txt.bz2
Content-length: 1436

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

--- Comment #2 from Alexander Cherepanov <ch3root at openwall dot com> ---
Example with a dead malloc (phiopt2):

----------------------------------------------------------------------
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>

__attribute__((noipa,optnone)) // imagine it in a separate TU
static void *opaque(void *p) { return p; }

static int been_there = 0;

static uintptr_t f(uintptr_t ip, uintptr_t iq)
{
    if (ip == iq) {
        been_there = 1;
        return ip;
    } else {
        been_there = 0;
        return iq;
    }
}

int main()
{
    int *q = malloc(sizeof(int));
    opaque(q);
    uintptr_t iq = (uintptr_t)(void *)q;
    free(q);

    int *p = malloc(sizeof(int));
    opaque(p);
    uintptr_t ip = (uintptr_t)(void *)p;

    uintptr_t ir = f(ip, iq);
    if (been_there) {
        *p = 1;
        *(int *)(void *)ir = 2;
        printf("result: %d\n", *p);
    }
}
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes test.c && ./a.out
result: 2
$ gcc -std=c11 -pedantic -Wall -Wextra -Wno-attributes -O3 test.c && ./a.out
result: 1
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.0 20191223 (experimental)
----------------------------------------------------------------------
>From gcc-bugs-return-663977-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 13:15:16 2019
Return-Path: <gcc-bugs-return-663977-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23160 invoked by alias); 23 Dec 2019 13:15:06 -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 22992 invoked by uid 48); 23 Dec 2019 13:15:01 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/61502] == comparison on "one-past" pointer gives wrong result
Date: Mon, 23 Dec 2019 13:15:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
X-Bugzilla-Status: SUSPENDED
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-61502-4-wgoaJtqzbn@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61502-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61502-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02047.txt.bz2
Content-length: 459

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

--- Comment #34 from Alexander Cherepanov <ch3root at openwall dot com> ---
It seems to me that problems with the optimization `if (p == q) use p` -> `if
(p == q) use q` (comment 4 etc.) are not specific to past-the-end pointers. So
I filed a separated bug for it with various testcases -- see pr93051.

The same for the optimization `p == q ? p : q` -> `q` (comment 30) -- see
pr93052.
>From gcc-bugs-return-663978-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 13:17:22 2019
Return-Path: <gcc-bugs-return-663978-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25529 invoked by alias); 23 Dec 2019 13:17:22 -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 24892 invoked by uid 48); 23 Dec 2019 13:17:17 -0000
From: "ch3root at openwall dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/65752] Too strong optimizations int -> pointer casts
Date: Mon, 23 Dec 2019 13:17:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ch3root at openwall dot com
X-Bugzilla-Status: NEW
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-65752-4-yMpHO54G8X@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65752-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65752-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02048.txt.bz2
Content-length: 494

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

--- Comment #60 from Alexander Cherepanov <ch3root at openwall dot com> ---
It seems to me that problems with the optimization `p == q ? p : q` -> `q`
(comment 15, comment 38, comment 56 etc.) are not specific to past-the-end
pointers. So I filed a separated bug for it with various testcases -- see
pr93052.

The same for the optimization `if (p == q) use p` -> `if (p == q) use q`
(comment 49, comment 52) -- see pr93051.
>From gcc-bugs-return-663979-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 13:20:29 2019
Return-Path: <gcc-bugs-return-663979-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 60776 invoked by alias); 23 Dec 2019 13:20:29 -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 60734 invoked by uid 48); 23 Dec 2019 13:20:25 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93052] Wrong optimizations for pointers: `p == q ? p : q` -> `q`
Date: Mon, 23 Dec 2019 13:20:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia 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-93052-4-SNvUyvvxSa@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93052-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93052-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02049.txt.bz2
Content-length: 167

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is a C defect report about these cases.
>From gcc-bugs-return-663980-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 14:03:49 2019
Return-Path: <gcc-bugs-return-663980-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 41406 invoked by alias); 23 Dec 2019 14:03:49 -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 41339 invoked by uid 48); 23 Dec 2019 14:03:45 -0000
From: "zhroma at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/93053] New: libgcc build failure with old binutils on aarch64
Date: Mon, 23 Dec 2019 14:03:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgcc
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: zhroma 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93053-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02050.txt.bz2
Content-length: 1985

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

            Bug ID: 93053
           Summary: libgcc build failure with old binutils on aarch64
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhroma at gcc dot gnu.org
  Target Milestone: ---

On cfarm gcc115 machine (aarch64): using trunk source (r279717), running
"./configure --prefix=... --enable-languages=c,c++,fortran; make -j3" got:

/home/zhroma/build/base/./gcc/xgcc -B/home/zhroma/build/base/./gcc/
-B/home/zhroma/inst/base/aarch64-unknown-linux-gnu/bin/
-B/home/zhroma/inst/base/aarch64-unknown-linux-gnu/lib/ -isystem
/home/zhroma/inst/base/aarch64-unknown-linux-gnu/include -isystem
/home/zhroma/inst/base/aarch64-unknown-linux-gnu/sys-include   -fno-checking -g
-O2 -O2  -g -O2 -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual
-Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition 
-isystem ./include   -fPIC -g -DIN_LIBGCC2 -fbuilding-libgcc
-fno-stack-protector   -fPIC -I. -I. -I../.././gcc
-I../../../../src/base/libgcc -I../../../../src/base/libgcc/.
-I../../../../src/base/libgcc/../gcc -I../../../../src/base/libgcc/../include 
-DHAVE_CC_TLS  -o cas_4_1.o -MT cas_4_1.o -MD -MP -MF cas_4_1.dep -DL_cas
-DSIZE=4 -DMODEL=1 -c ../../../../src/base/libgcc/config/aarch64/lse.S
../../../../src/base/libgcc/config/aarch64/lse.S: Assembler messages:
../../../../src/base/libgcc/config/aarch64/lse.S:52: Error: unknown
architectural extension `lse'
../../../../src/base/libgcc/config/aarch64/lse.S:149: Error: unknown mnemonic
`casb' -- `casb w0,w1,[x2]'

$ cat stage_current
stage1

$/usr/bin/as --version
GNU assembler (GNU Binutils for Ubuntu) 2.24
Copyright 2013 Free Software Foundation, Inc.

I think it should happen since r275967, but haven't actually checked that.
>From gcc-bugs-return-663981-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 14:13:27 2019
Return-Path: <gcc-bugs-return-663981-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15120 invoked by alias); 23 Dec 2019 14:13:27 -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 15091 invoked by uid 48); 23 Dec 2019 14:13:23 -0000
From: "asolokha at gmx dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/93054] New: ICE in gimple_set_lhs, at gimple.c:1820
Date: Mon, 23 Dec 2019 14:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: asolokha at gmx dot com
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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-93054-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02051.txt.bz2
Content-length: 4035

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

            Bug ID: 93054
           Summary: ICE in gimple_set_lhs, at gimple.c:1820
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gcc-10.0.0-alpha20191215 snapshot (r279712), 9.2, 8.3, 7.3 ICE when compiling
the following testcase:

__attribute__ ((returns_twice)) int
bp (int);

__attribute__ ((noreturn)) int
cb (void)
{
  return bp (cb ());
}

% gcc-10.0.0-alpha20191215 -w -c zb7r2q8j.c
zb7r2q8j.c: In function 'cb':
zb7r2q8j.c:7:10: internal compiler error: in gimple_set_lhs, at gimple.c:1820
    7 |   return bp (cb ());
      |          ^~~~~~~~~~
0x611d38 gimple_set_lhs(gimple*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimple.c:1820
0xa8f8cf gimplify_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:14427
0xa91595 gimplify_call_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:3485
0xa8709f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:13340
0xa9c8e1 gimplify_modify_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:5753
0xa85bd5 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:13368
0xa89430 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:6810
0xa90e35 gimplify_and_add(tree_node*, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:482
0xa90e35 gimplify_return_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:1655
0xa8663b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:13629
0xa89430 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:6810
0xa8a1e5 gimplify_bind_expr
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:1420
0xa870ca gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:13569
0xa9de54 gimplify_stmt(tree_node**, gimple**)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:6810
0xa9de54 gimplify_body(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:14616
0xa9e29c gimplify_function_tree(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/gimplify.c:14760
0x8f0ab2 cgraph_node::analyze()
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/cgraphunit.c:669
0x8f33ae analyze_functions
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/cgraphunit.c:1212
0x8f3fa8 symbol_table::finalize_compilation_unit()
       
/var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191215/work/gcc-10-20191215/gcc/cgraphunit.c:2958
>From gcc-bugs-return-663982-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 15:08:53 2019
Return-Path: <gcc-bugs-return-663982-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 57491 invoked by alias); 23 Dec 2019 15:08:52 -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 57443 invoked by uid 48); 23 Dec 2019 15:08:48 -0000
From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/37377] [4.4 Regression] Bootstrap failure compiling libgcc
Date: Mon, 23 Dec 2019 15:08:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 4.4.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: rearnsha at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.4.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-37377-4-7rzWDQcimv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-37377-4@http.gcc.gnu.org/bugzilla/>
References: <bug-37377-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02052.txt.bz2
Content-length: 154

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

--- Comment #17 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
last patch was for pr37577.
>From gcc-bugs-return-663983-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 15:31:03 2019
Return-Path: <gcc-bugs-return-663983-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 71617 invoked by alias); 23 Dec 2019 15:31:03 -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 71579 invoked by uid 48); 23 Dec 2019 15:30:59 -0000
From: "zhroma at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/93053] libgcc build failure with old binutils on aarch64
Date: Mon, 23 Dec 2019 15:31:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgcc
X-Bugzilla-Version: 10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: zhroma 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-93053-4-uPAhfKqgXX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-93053-4@http.gcc.gnu.org/bugzilla/>
References: <bug-93053-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2019-12/txt/msg02053.txt.bz2
Content-length: 163

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

--- Comment #1 from Roman Zhuykov <zhroma at gcc dot gnu.org> ---
Now I can confirm it started with r275967.
>From gcc-bugs-return-663984-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Dec 23 15:52:10 2019
Return-Path: <gcc-bugs-return-663984-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 89721 invoked by alias); 23 Dec 2019 15:52:10 -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 89713 invoked by uid 89); 23 Dec 2019 15:52:09 -0000
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=furthermore, H*c:ISO-8859-1
X-HELO: mail-lj1-f181.google.com
Received: from mail-lj1-f181.google.com (HELO mail-lj1-f181.google.com) (209.85.208.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 23 Dec 2019 15:52:08 +0000
Received: by mail-lj1-f181.google.com with SMTP id k8so18158593ljh.5        for <gcc-bugs@gcc.gnu.org>; Mon, 23 Dec 2019 07:52:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com; s 161025;        h=message-id:subject:from:reply-to:to:date:in-reply-to:references         :organization:user-agent:mime-version:content-transfer-encoding;        bh=vx1YGT6DLKfhJxg7NxoyCAx/5LEXzgqmp017Kcg8NII=;        b=kQ7JavyoXrP0MYoklM4abva95CqnR+WcmQmR2gJ0rQXe4X/P7rfPP3LKXfKp1IPLJ+         oeF2AhiFi8JwjwGK/Bf+AqSB+6EIZZWcj8Uclp4na13Xv5HaCEz/BMAQQXtQ6OA8vBxb         lHbcVUvsFlEykn2+1g8TJBQlMhS6y17oT1z+UxjVDAFeIE5TDB5u3TpDC4hkfDopDa1s         JQ7ArahV60CR7Hm5pVrtSYsoduv3oC6e2HQGcT0C1Q8xvZIQzJrRRyKrWhiPIMgOBJV9         Df1DTuq0sifLsqoExu22GD2PYmGDZV5ZxoDGPh6Mt1XwduG6YZNNX6f+bIr0MFQf8Gvw         k4mg=Return-Path: <svante.signell@gmail.com>
Received: from G3620.lan (178-78-231-178.customers.ownit.se. [178.78.231.178])        by smtp.gmail.com with ESMTPSA id v8sm7741796lji.16.2019.12.23.07.52.04        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits%6/256);        Mon, 23 Dec 2019 07:52:05 -0800 (PST)
Message-ID: <02dde24af949eb05f5d6dbbeece49f70e869035e.camel@gmail.com>
Subject: Re: [Bug other/93049] limits.h generated by fixincludes breaks cross-compilation
From: Svante Signell <svante.signell@gmail.com>
Reply-To: svante.signell@gmail.com
To: gcc-bugs@gcc.gnu.org
Date: Mon, 23 Dec 2019 15:52:00 -0000
In-Reply-To: <bug-93049-4-JEHAfbLSBS@http.gcc.gnu.org/bugzilla/>
References: <bug-93049-4@http.gcc.gnu.org/bugzilla/>	 <bug-93049-4-JEHAfbLSBS@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="ISO-8859-1"
User-Agent: Evolution 3.30.5-1.1
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
X-SW-Source: 2019-12/txt/msg02054.txt.bz2
Content-length: 1663

On Mon, 2019-12-23 at 10:09 +0000, schwab@linux-m68k.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id“049
>
> --- Comment #1 from Andreas Schwab <schwab@linux-m68k.org> ---
> Make sure you have sysroot properly set up so that the gcc Makefile finds the
> system limits.h.

Do you mean this:
tmp/src/gcc-9.2.0/configure --help|grep sysroot
  --with-build-sysroot=SYSROOT
                          use sysroot as the system root during the build
or this:
sed-4.7/configure --help|grep sysroot <empty>
coreutils-8.31/configure --help|grep sysroot <empty>
Linux-PAM-1.3.1/configure --help|grep sysroot
 --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                          compiler's sysroot if not specified).

The cross-built gcc, generating code for i686-pc-gnu was created with a a little
hairy bootstrap procedure:
binutils
gnumach headers
hurd headers
first gcc
mig
first glibc
full gcc
full glibc <- This is the gcc built for building the Hurd-executable packages.
(and cross-building these packages is even more hairy)

Back to the fixinclude version of limits.h. Is there any specific reason to set
MB_LEN_MAX to 1, when the system version use 16? Furthermore, in my
understanding fixincludes was/is mainly used to convert non-posix header files?
Why then chop off the end of the system limits.h:

#ifdef __USE_POSIX
/* POSIX adds things to <limits.h>.  */
# include <bits/posix1_lim.h>
#endif

#ifdef __USE_POSIX2
# include <bits/posix2_lim.h>
#endif

#ifdef __USE_XOPEN
# include <bits/xopen_lim.h>
#endif

It seem like the only file modified by fixincludes is limits.h. Is that file
not-posix compliant enough?


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

* [Bug tree-optimization/93044] extra cast is not removed
       [not found] <bug-93044-4@http.gcc.gnu.org/bugzilla/>
  2019-12-22 13:43 ` [Bug tree-optimization/93044] extra cast is not removed glisse at gcc dot gnu.org
@ 2021-11-22  9:25 ` pinskia at gcc dot gnu.org
  2023-07-24 23:49 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-11-22  9:25 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org
      Known to fail|                            |4.9.0
             Status|NEW                         |ASSIGNED

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Will look to fix this, maybe in GCC 13.

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

* [Bug tree-optimization/93044] extra cast is not removed
       [not found] <bug-93044-4@http.gcc.gnu.org/bugzilla/>
  2019-12-22 13:43 ` [Bug tree-optimization/93044] extra cast is not removed glisse at gcc dot gnu.org
  2021-11-22  9:25 ` pinskia at gcc dot gnu.org
@ 2023-07-24 23:49 ` pinskia at gcc dot gnu.org
  2023-08-01  0:07 ` cvs-commit at gcc dot gnu.org
  2023-08-01  0:08 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-07-24 23:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-July/625379.html

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

* [Bug tree-optimization/93044] extra cast is not removed
       [not found] <bug-93044-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2023-07-24 23:49 ` pinskia at gcc dot gnu.org
@ 2023-08-01  0:07 ` cvs-commit at gcc dot gnu.org
  2023-08-01  0:08 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-01  0:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <pinskia@gcc.gnu.org>:

https://gcc.gnu.org/g:cc2003cd87532f319c94028f17d20a327df5ccfa

commit r14-2890-gcc2003cd87532f319c94028f17d20a327df5ccfa
Author: Andrew Pinski <apinski@marvell.com>
Date:   Sun Jul 23 21:44:39 2023 +0000

    Fix PR 93044: extra cast is not removed

    In this case we are not removing convert to a bigger size
    back to the same size (or smaller) if signedness does not
    match.
    For an example:
    ```
      signed char _1;
    ...
      _1 = *a_4(D);
      b_5 = (short unsigned int) _1;
      _2 = (unsigned char) b_5;
    ```
    The inner cast is not needed and can be removed but was not.
    The match pattern for removing the extra cast is overly
    complex so decided to add a new case for rather than trying
    to modify the current if statement here.

    Committed as approved. Bootstrapped and tested on x86_64-linux-gnu with no
regressions.

    gcc/ChangeLog:

            PR tree-optimization/93044
            * match.pd (nested int casts): A truncation (to the same size or
smaller)
            can always remove the inner cast.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/93044
            * gcc.dg/tree-ssa/cast-1.c: New test.
            * gcc.dg/tree-ssa/cast-2.c: New test.

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

* [Bug tree-optimization/93044] extra cast is not removed
       [not found] <bug-93044-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2023-08-01  0:07 ` cvs-commit at gcc dot gnu.org
@ 2023-08-01  0:08 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-08-01  0:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-08-01  0:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93044-4@http.gcc.gnu.org/bugzilla/>
2019-12-22 13:43 ` [Bug tree-optimization/93044] extra cast is not removed glisse at gcc dot gnu.org
2021-11-22  9:25 ` pinskia at gcc dot gnu.org
2023-07-24 23:49 ` pinskia at gcc dot gnu.org
2023-08-01  0:07 ` cvs-commit at gcc dot gnu.org
2023-08-01  0:08 ` pinskia 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).