public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/104064] New: gcc/tree-vect-data-refs.c:3208:16: runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be represented in type 'long int'
@ 2022-01-17 10:54 marxin at gcc dot gnu.org
  2022-01-18  8:08 ` [Bug tree-optimization/104064] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-17 10:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104064
           Summary: gcc/tree-vect-data-refs.c:3208:16: runtime error:
                    signed integer overflow: 17 - -9223372036854775806
                    cannot be represented in type 'long int'
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org
            Blocks: 63426
  Target Milestone: ---

We may have a dup of it as g[2305843009213693952ULL].c is telling for an UBSAN
;)

$ ./xgcc -B.
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/torture/pr103816.c -c -O2
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/tree-vect-data-refs.c:3208:16:
runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be
represented in type 'long int'
    #0 0x741ec5b in vect_analyze_data_ref_accesses(vec_info*, vec<int, va_heap,
vl_ptr>*)
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/tree-vect-data-refs.c:3208
    #1 0x34df715 in vect_slp_analyze_bb_1
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/tree-vect-slp.c:5728
    #2 0x34df715 in vect_slp_region
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/tree-vect-slp.c:5864
    #3 0x34ec6b5 in vect_slp_bbs
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/tree-vect-slp.c:6056
    #4 0x34ed913 in vect_slp_function(function*)
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/tree-vect-slp.c:6144
    #5 0x3547f13 in execute
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/tree-vectorizer.c:1503
    #6 0x224e7e8 in execute_one_pass(opt_pass*)
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/passes.c:2637
    #7 0x2251b34 in execute_pass_list_1
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/passes.c:2737
    #8 0x2251b7b in execute_pass_list_1
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/passes.c:2738
    #9 0x2251b7b in execute_pass_list_1
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/passes.c:2738
    #10 0x2251c45 in execute_pass_list(function*, opt_pass*)
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/passes.c:2748
    #11 0xff3c2d in cgraph_node::expand()
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/cgraphunit.c:1834
    #12 0xff91be in expand_all_functions
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/cgraphunit.c:1998
    #13 0xff91be in symbol_table::compile()
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/cgraphunit.c:2348
    #14 0xff91be in symbol_table::compile()
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/cgraphunit.c:2259
    #15 0x1007b3a in symbol_table::finalize_compilation_unit()
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/cgraphunit.c:2529
    #16 0x27a309f in compile_file
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/toplev.c:479
    #17 0x98cf39 in do_compile
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/toplev.c:2158
    #18 0x98cf39 in toplev::main(int, char**)
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/toplev.c:2310
    #19 0x992531 in main
/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/build/gcc/main.c:39
    #20 0x7ffff78855bf in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
    #21 0x7ffff788567b in __libc_start_main_impl ../csu/libc-start.c:409
    #22 0x992754 in _start
(/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-ubsan/objdir/gcc/cc1+0x992754)


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63426
[Bug 63426] [meta-bug] Issues found with -fsanitize=undefined

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

* [Bug tree-optimization/104064] gcc/tree-vect-data-refs.c:3208:16: runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be represented in type 'long int'
  2022-01-17 10:54 [Bug tree-optimization/104064] New: gcc/tree-vect-data-refs.c:3208:16: runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be represented in type 'long int' marxin at gcc dot gnu.org
@ 2022-01-18  8:08 ` rguenth at gcc dot gnu.org
  2022-01-18  9:29 ` cvs-commit at gcc dot gnu.org
  2022-01-18  9:29 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-18  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-01-18
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I have a patch.

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

* [Bug tree-optimization/104064] gcc/tree-vect-data-refs.c:3208:16: runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be represented in type 'long int'
  2022-01-17 10:54 [Bug tree-optimization/104064] New: gcc/tree-vect-data-refs.c:3208:16: runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be represented in type 'long int' marxin at gcc dot gnu.org
  2022-01-18  8:08 ` [Bug tree-optimization/104064] " rguenth at gcc dot gnu.org
@ 2022-01-18  9:29 ` cvs-commit at gcc dot gnu.org
  2022-01-18  9:29 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-18  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

https://gcc.gnu.org/g:00dc7877ee02634d4837d024e36b55bef6b9d49c

commit r12-6660-g00dc7877ee02634d4837d024e36b55bef6b9d49c
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jan 18 09:06:13 2022 +0100

    tree-optimization/104064 - UBSAN issue in vect dataref analysis

    Since we order DRs after DR_INIT we know the difference will be
    positive and thus can avoid signed overflow issues by using
    unsigned arithmetic to produce the known unsigned result.

    2022-01-18  Richard Biener  <rguenther@suse.de>

            PR tree-optimization/104064
            * tree-vect-data-refs.cc (vect_analyze_data_ref_accesses): Check
            DR_INIT fits in a signed HWI, represent the difference from the
            first DR in unsigned.

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

* [Bug tree-optimization/104064] gcc/tree-vect-data-refs.c:3208:16: runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be represented in type 'long int'
  2022-01-17 10:54 [Bug tree-optimization/104064] New: gcc/tree-vect-data-refs.c:3208:16: runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be represented in type 'long int' marxin at gcc dot gnu.org
  2022-01-18  8:08 ` [Bug tree-optimization/104064] " rguenth at gcc dot gnu.org
  2022-01-18  9:29 ` cvs-commit at gcc dot gnu.org
@ 2022-01-18  9:29 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-18  9:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2022-01-18  9:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 10:54 [Bug tree-optimization/104064] New: gcc/tree-vect-data-refs.c:3208:16: runtime error: signed integer overflow: 17 - -9223372036854775806 cannot be represented in type 'long int' marxin at gcc dot gnu.org
2022-01-18  8:08 ` [Bug tree-optimization/104064] " rguenth at gcc dot gnu.org
2022-01-18  9:29 ` cvs-commit at gcc dot gnu.org
2022-01-18  9:29 ` rguenth 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).