public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/68122] New: ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm
@ 2015-10-27 21:41 larsbj at gullik dot net
  2015-10-28  7:50 ` [Bug sanitizer/68122] " chefmax at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: larsbj at gullik dot net @ 2015-10-27 21:41 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: 8250 bytes --]

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

            Bug ID: 68122
           Summary: ICE in gcc/toplev.c:353 with -fsanitize=undefined and
                    -fgnu-tm
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: larsbj at gullik dot net
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

This program:

int cnt = 0;

int main(void)
{
  __transaction_atomic {
    cnt++;
  }
}

Gives

tm-thread.c: In function ‘main’:
tm-thread.c:8:1: internal compiler error: Segmentation fault
 }
 ^
0x98b74f crash_signal
        ../../gcc/gcc/toplev.c:353
0x98f8e4 is_tm_pure_call
        ../../gcc/gcc/trans-mem.c:275
0x98ff19 ipa_tm_scan_calls_block
        ../../gcc/gcc/trans-mem.c:4158
0x993653 ipa_tm_scan_calls_transaction
        ../../gcc/gcc/trans-mem.c:4211
0x993653 ipa_tm_execute
        ../../gcc/gcc/trans-mem.c:5385
0x993653 execute
        ../../gcc/gcc/trans-mem.c:5623

When compiled with

gcc (GCC) 6.0.0 20151022 (experimental)
>From gcc-bugs-return-500730-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 27 21:45:35 2015
Return-Path: <gcc-bugs-return-500730-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 130726 invoked by alias); 27 Oct 2015 21:45:34 -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 130663 invoked by uid 48); 27 Oct 2015 21:45:27 -0000
From: "larsbj at gullik dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/68122] ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm
Date: Tue, 27 Oct 2015 21:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: larsbj at gullik 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-68122-4-y15SKY71h8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-68122-4@http.gcc.gnu.org/bugzilla/>
References: <bug-68122-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: 2015-10/txt/msg02285.txt.bz2
Content-length: 201

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

--- Comment #1 from Lars Gullik Bjønnes <larsbj at gullik dot net> ---
Command used to call:

gcc -fsanitize=undefined -fgnu-tm tm-thread.c
>From gcc-bugs-return-500731-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 27 21:58:13 2015
Return-Path: <gcc-bugs-return-500731-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14062 invoked by alias); 27 Oct 2015 21:58:13 -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 14028 invoked by uid 48); 27 Oct 2015 21:58:09 -0000
From: "juergen.reuter at desy dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/68108] [6 regression] erroneous error message 'scalar integer expression expected'
Date: Tue, 27 Oct 2015 21:58: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: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: juergen.reuter at desy dot de
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: kargl at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-68108-4-O2c07wV6lR@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-68108-4@http.gcc.gnu.org/bugzilla/>
References: <bug-68108-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: 2015-10/txt/msg02286.txt.bz2
Content-length: 221

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

--- Comment #7 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Thanks to Steven Kargl: confirming that our code completely works again with
gcc's r229446.
>From gcc-bugs-return-500732-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 27 22:00:31 2015
Return-Path: <gcc-bugs-return-500732-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15741 invoked by alias); 27 Oct 2015 22:00:31 -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 15547 invoked by uid 48); 27 Oct 2015 22:00:27 -0000
From: "dxin at usc dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/68123] New: GCC vector extension behaves funny with large vector size
Date: Tue, 27 Oct 2015 22:00: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: 4.8.3
X-Bugzilla-Keywords:
X-Bugzilla-Severity: minor
X-Bugzilla-Who: dxin at usc dot edu
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-68123-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg02287.txt.bz2
Content-length: 1047

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

            Bug ID: 68123
           Summary: GCC vector extension behaves funny with large vector
                    size
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dxin at usc dot edu
  Target Milestone: ---

Created attachment 36599
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id6599&actioníit
test source file

It would complete unroll the loop and produces a huge assembly.
With -O3 the produced assembly is smaller, but compilation takes a lot longer
than no -O3.

I attached test source file.
With
CFLAGS=-std=gnu11 -O3 -mcpu=cortex-a9 -mfloat-abi=hard -mfpu=neon -fPIE -Wall
-S -fverbose-asm
it compiles to a 57K line assembly and takes about 2min to compile, on a XEON
1245v3 machine.

Tested on "GCC: (crosstool-NG linaro-1.13.1-4.8-2013.11 - Linaro GCC 2013.10)
4.8.3 20131111 (prerelease)"


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

* [Bug sanitizer/68122] ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm
  2015-10-27 21:41 [Bug sanitizer/68122] New: ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm larsbj at gullik dot net
@ 2015-10-28  7:50 ` chefmax at gcc dot gnu.org
  2015-10-28 12:04 ` [Bug middle-end/68122] " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: chefmax at gcc dot gnu.org @ 2015-10-28  7:50 UTC (permalink / raw)
  To: gcc-bugs

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

Maxim Ostapenko <chefmax at gcc dot gnu.org> changed:

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

--- Comment #2 from Maxim Ostapenko <chefmax at gcc dot gnu.org> ---
$ cat tm-thread.c.019t.ubsan

;; Function main (main, funcdef_no=0, decl_uid=2229, cgraph_uid=0,
symbol_order=1)

main ()
{
  int D.2233;
  int cnt.0;
  int D.2234;
  int cnt.0_2;
  int _3;
  int _6;

  <bb 2>:
  __transaction_atomic  // SUBCODE=[ GTMA_HAVE_LOAD GTMA_HAVE_STORE ]

  <bb 3>:
  cnt.0_2 = cnt;
  _3 = UBSAN_CHECK_ADD (cnt.0_2, 1);
  cnt = _3;
  __builtin__ITM_commitTransaction ();

  <bb 4>:
  _6 = 0;

<L0>:
  return _6;

}

It seems that pass_ipa_tm tries to handle UBSAN_CHECK_ADD call and fails.
Should we teach it to handle ubsan intrinsics? Or maybe just not instrument
transaction clauses at all?


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

* [Bug middle-end/68122] ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm
  2015-10-27 21:41 [Bug sanitizer/68122] New: ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm larsbj at gullik dot net
  2015-10-28  7:50 ` [Bug sanitizer/68122] " chefmax at gcc dot gnu.org
@ 2015-10-28 12:04 ` rguenth at gcc dot gnu.org
  2022-01-04  2:42 ` [Bug middle-end/68122] ICE in is_tm_pure_call " pinskia at gcc dot gnu.org
  2023-11-27  8:57 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-28 12:04 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |trans-mem
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-28
          Component|sanitizer                   |middle-end
     Ever confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks like it doesn't handle internal function calls properly.

/* Return true if CALL is const, or tm_pure.  */

static bool
is_tm_pure_call (gimple *call)
{
  tree fn = gimple_call_fn (call);

  if (TREE_CODE (fn) == ADDR_EXPR)
    {
      fn = TREE_OPERAND (fn, 0);
      gcc_assert (TREE_CODE (fn) == FUNCTION_DECL);
    }
  else


fn will be NULL for internal functions.


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

* [Bug middle-end/68122] ICE in is_tm_pure_call with -fsanitize=undefined and -fgnu-tm
  2015-10-27 21:41 [Bug sanitizer/68122] New: ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm larsbj at gullik dot net
  2015-10-28  7:50 ` [Bug sanitizer/68122] " chefmax at gcc dot gnu.org
  2015-10-28 12:04 ` [Bug middle-end/68122] " rguenth at gcc dot gnu.org
@ 2022-01-04  2:42 ` pinskia at gcc dot gnu.org
  2023-11-27  8:57 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-04  2:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stefansf at linux dot ibm.com

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 93782 has been marked as a duplicate of this bug. ***

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

* [Bug middle-end/68122] ICE in is_tm_pure_call with -fsanitize=undefined and -fgnu-tm
  2015-10-27 21:41 [Bug sanitizer/68122] New: ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm larsbj at gullik dot net
                   ` (2 preceding siblings ...)
  2022-01-04  2:42 ` [Bug middle-end/68122] ICE in is_tm_pure_call " pinskia at gcc dot gnu.org
@ 2023-11-27  8:57 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-27  8:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iamanonymous.cs at gmail dot com

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 112720 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2023-11-27  8:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-27 21:41 [Bug sanitizer/68122] New: ICE in gcc/toplev.c:353 with -fsanitize=undefined and -fgnu-tm larsbj at gullik dot net
2015-10-28  7:50 ` [Bug sanitizer/68122] " chefmax at gcc dot gnu.org
2015-10-28 12:04 ` [Bug middle-end/68122] " rguenth at gcc dot gnu.org
2022-01-04  2:42 ` [Bug middle-end/68122] ICE in is_tm_pure_call " pinskia at gcc dot gnu.org
2023-11-27  8:57 ` 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).