public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/64344] New: [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow]
@ 2014-12-17 17:25 burnus at gcc dot gnu.org
  2014-12-17 17:28 ` [Bug sanitizer/64344] " burnus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-12-17 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64344
           Summary: [5 Regression] [UBSAN] ICE with
                    -fsanitize=float-cast-overflow [ICE in
                    -fsanitize=float-cast-overflow]
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
                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,
                    mpolacek at gcc dot gnu.org

New since today:


$ gcc -w -fsanitize=float-cast-overflow new8.i

new8.i: In function ‘float2long’:
new8.i:11:23: internal compiler error: in -fsanitize=float-cast-overflow
   *exponent = (int32 )log((double )value);
                       ^
0x9058fb gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gimplify.c:8451


For the following program:

/* ----------------------------------------------------------*/

typedef enum {
  PARAPROX_Q_EXTRA_FAST = 4
} pthread_cond_t;
extern int drand48_r (struct drand48_data *__restrict __buffer,
       int __reject3)
{
}
typedef int int32;
float2long(int32 *mantisse, int32 *exponent, float value)
{
  *exponent = (int32 )log((double )value);
}
>From gcc-bugs-return-471015-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Dec 17 17:25:45 2014
Return-Path: <gcc-bugs-return-471015-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15695 invoked by alias); 17 Dec 2014 17:25:44 -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 15486 invoked by uid 48); 17 Dec 2014 17:25:40 -0000
From: "Joost.VandeVondele at mat dot ethz.ch" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/64343] [5 Regression] lto compile options
Date: Wed, 17 Dec 2014 17:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: Joost.VandeVondele at mat dot ethz.ch
X-Bugzilla-Status: RESOLVED
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 resolution
Message-ID: <bug-64343-4-HxAt8PgP0o@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64343-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64343-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: 2014-12/txt/msg02022.txt.bz2
Content-length: 470

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

Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #3 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> ---
OK,fine with me.


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

* [Bug sanitizer/64344] [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow]
  2014-12-17 17:25 [Bug sanitizer/64344] New: [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow] burnus at gcc dot gnu.org
@ 2014-12-17 17:28 ` burnus at gcc dot gnu.org
  2014-12-18 10:08 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-12-17 17:28 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |5.0

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #0)
> New since today:
Tested with r218820, I think it was working this morning (r218809?).


> new8.i: In function ‘float2long’:
> new8.i:11:23: internal compiler error: in -fsanitize=float-cast-overflow

Pasto - should have been:


$ gcc -w -fsanitize=float-cast-overflow new8.i

new8.i: In function ‘float2long’:
new8.i:11:23: internal compiler error: in gimplify_expr, at gimplify.c:8451
   *exponent = (int32 )log((double )value);
                       ^
0x9058fb gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gimplify.c:8451
>From gcc-bugs-return-471016-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Dec 17 17:28:05 2014
Return-Path: <gcc-bugs-return-471016-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17564 invoked by alias); 17 Dec 2014 17:28:05 -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 16958 invoked by uid 48); 17 Dec 2014 17:27:58 -0000
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/64325] [5 Regression] ICE: Segmentation fault
Date: Wed, 17 Dec 2014 17:28: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: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: hubicka at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P1
X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on assigned_to everconfirmed
Message-ID: <bug-64325-4-6PC9IU3LqT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64325-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64325-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: 2014-12/txt/msg02023.txt.bz2
Content-length: 560

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

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-12-17
           Assignee|unassigned at gcc dot gnu.org      |hubicka at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
mine.


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

* [Bug sanitizer/64344] [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow]
  2014-12-17 17:25 [Bug sanitizer/64344] New: [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow] burnus at gcc dot gnu.org
  2014-12-17 17:28 ` [Bug sanitizer/64344] " burnus at gcc dot gnu.org
@ 2014-12-18 10:08 ` jakub at gcc dot gnu.org
  2015-01-05 21:47 ` jakub at gcc dot gnu.org
  2015-01-05 22:07 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-18 10:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34297|0                           |1
        is obsolete|                            |
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-12-18
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 34298
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34298&action=edit
gcc5-pr64344.patch

Better patch.


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

* [Bug sanitizer/64344] [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow]
  2014-12-17 17:25 [Bug sanitizer/64344] New: [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow] burnus at gcc dot gnu.org
  2014-12-17 17:28 ` [Bug sanitizer/64344] " burnus at gcc dot gnu.org
  2014-12-18 10:08 ` jakub at gcc dot gnu.org
@ 2015-01-05 21:47 ` jakub at gcc dot gnu.org
  2015-01-05 22:07 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-05 21:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Mon Jan  5 21:46:31 2015
New Revision: 219201

URL: https://gcc.gnu.org/viewcvs?rev=219201&root=gcc&view=rev
Log:
    PR sanitizer/64344
    * ubsan.h (ubsan_instrument_float_cast): Add ARG argument.
    * ubsan.c (ubsan_instrument_float_cast): Add ARG argument, pass
    it to libubsan handler instead of EXPR.  Fold comparisons earlier,
    if the result is integer_zerop, return NULL_TREE.
    * convert.c (convert_to_integer): Pass expr as ARG.
c/
    * c-typeck.c (convert_for_assignment, c_finish_return): For
    -fsanitize=float-cast-overflow casts from REAL_TYPE to integer/enum
    types also set in_late_binary_op around convert call.
    * c-convert.c (convert): For -fsanitize=float-cast-overflow REAL_TYPE
    to integral type casts, if not in_late_binary_op, pass c_fully_fold
    result on expr as last argument to ubsan_instrument_float_cast,
    if in_late_binary_op, don't use c_save_expr but save_expr.
testsuite/
    * c-c++-common/ubsan/pr64344-1.c: New test.
    * c-c++-common/ubsan/pr64344-2.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/ubsan/pr64344-1.c
    trunk/gcc/testsuite/c-c++-common/ubsan/pr64344-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-convert.c
    trunk/gcc/c/c-typeck.c
    trunk/gcc/convert.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/ubsan.c
    trunk/gcc/ubsan.h


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

* [Bug sanitizer/64344] [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow]
  2014-12-17 17:25 [Bug sanitizer/64344] New: [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow] burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-01-05 21:47 ` jakub at gcc dot gnu.org
@ 2015-01-05 22:07 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-01-05 22:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-01-05 22:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-17 17:25 [Bug sanitizer/64344] New: [5 Regression] [UBSAN] ICE with -fsanitize=float-cast-overflow [ICE in -fsanitize=float-cast-overflow] burnus at gcc dot gnu.org
2014-12-17 17:28 ` [Bug sanitizer/64344] " burnus at gcc dot gnu.org
2014-12-18 10:08 ` jakub at gcc dot gnu.org
2015-01-05 21:47 ` jakub at gcc dot gnu.org
2015-01-05 22:07 ` jakub 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).