public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/109759] New: UBSAN error: shift exponent 64 is too large for 64-bit type 'long unsigned int'
@ 2023-05-06 21:22 jamborm at gcc dot gnu.org
  2023-05-08  7:12 ` [Bug tree-optimization/109759] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-05-06 21:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109759
           Summary: UBSAN error: shift exponent 64 is too large for 64-bit
                    type 'long unsigned int'
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jamborm at gcc dot gnu.org
                CC: aldyh at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

Bootstrap with undefined behavior sanitizer and subsequent run of the
testsuite (on revision b7fe38c14e5) reports a new error when compiling
Fortran testcase assumed_charlen_function_2.f90:

spawn -ignore SIGHUP
/home/worker/buildworker/tiber-gcc-ubsan/objdir/gcc/testsuite/gfortran/../../gfortran
-B/home/worker/buildworker/tiber-gcc-ubsan/objdir/gcc/testsuite/gfortran/../../
-B/home/worker/buildworker/tiber-gcc-ubsan/objdir/x86_64-pc-linux-gnu/./libgfortran/
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/testsuite/gfortran.dg/assumed_charlen_function_2.f90
-fdiagnostics-plain-output -fdiagnostics-plain-output -O -pedantic-errors -S -o
assumed_charlen_function_2.s

/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/hwint.h:293:61: runtime
error: shift exponent 64 is too large for 64-bit type 'long unsigned int'

#0 0x11d0a1b in sext_hwi(long, unsigned int)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/hwint.h:293
    #1 0x11d0a1b in wi::hwi_with_prec::hwi_with_prec(long, unsigned int,
signop) /home/worker/buildworker/tiber-gcc-ubsan/build/gcc/wide-int.h:1622
    #2 0x11d0a1b in wi::shwi(long, unsigned int)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/wide-int.h:1631
    #3 0x11d0a1b in wi::minus_one(unsigned int)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/wide-int.h:1645
    #4 0x11d0a1b in irange::set_varying(tree_node*)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/value-range.h:833
    #5 0x25d2b37 in range_cast(vrange&, tree_node*)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/range-op.cc:4860
    #6 0x1e87976 in ipa_compute_jump_functions_for_edge
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/ipa-prop.cc:2325
    #7 0x1e8af36 in ipa_compute_jump_functions_for_bb
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/ipa-prop.cc:2449
    #8 0x1e8af36 in analysis_dom_walker::before_dom_children(basic_block_def*)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/ipa-prop.cc:3035
    #9 0x69a8253 in dom_walker::walk(basic_block_def*)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/domwalk.cc:311
    #10 0x1e845e1 in ipa_analyze_node(cgraph_node*)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/ipa-prop.cc:3103
    #11 0x1d07117 in inline_indirect_intraprocedural_analysis
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/ipa-fnsummary.cc:4315
    #12 0x1d07117 in inline_analyze_function(cgraph_node*)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/ipa-fnsummary.cc:4334
    #13 0x1d0779c in ipa_fn_summary_generate
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/ipa-fnsummary.cc:4378
    #14 0x24af751 in execute_ipa_summary_passes(ipa_opt_pass_d*)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/passes.cc:2304
    #15 0x14110b3 in ipa_passes
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/cgraphunit.cc:2235
    #16 0x14110b3 in symbol_table::compile()
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/cgraphunit.cc:2331
    #17 0x14110b3 in symbol_table::compile()
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/cgraphunit.cc:2309
    #18 0x141368a in symbol_table::finalize_compilation_unit()
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/cgraphunit.cc:2583
    #19 0x2a3e691 in compile_file
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/toplev.cc:471
    #20 0xa565be in do_compile
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/toplev.cc:2126
    #21 0xa565be in toplev::main(int, char**)
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/toplev.cc:2278
    #22 0xa59971 in main
/home/worker/buildworker/tiber-gcc-ubsan/build/gcc/main.cc:39
    #23 0x7f6e44272baf in __libc_start_call_main (/lib64/libc.so.6+0x27baf)
(BuildId: 9854a3cd243b5cfbf99999e26f7fbb65e62146c7)
    #24 0x7f6e44272c78 in __libc_start_main_alias_1 (/lib64/libc.so.6+0x27c78)
(BuildId: 9854a3cd243b5cfbf99999e26f7fbb65e62146c7)
    #25 0xa59da4 in _start ../sysdeps/x86_64/start.S:115

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

* [Bug tree-optimization/109759] UBSAN error: shift exponent 64 is too large for 64-bit type 'long unsigned int'
  2023-05-06 21:22 [Bug ipa/109759] New: UBSAN error: shift exponent 64 is too large for 64-bit type 'long unsigned int' jamborm at gcc dot gnu.org
@ 2023-05-08  7:12 ` rguenth at gcc dot gnu.org
  2023-05-10 11:10 ` jamborm at gcc dot gnu.org
  2023-05-17  8:44 ` jamborm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-08  7:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Odd, the code is explicitely guarded:

inline wi::hwi_with_prec::hwi_with_prec (HOST_WIDE_INT v, unsigned int p,
                                         signop s)
  : precision (p), sgn (s)
{
  if (precision < HOST_BITS_PER_WIDE_INT)
    val = sext_hwi (v, precision);

and in sext_hwi as well.

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

* [Bug tree-optimization/109759] UBSAN error: shift exponent 64 is too large for 64-bit type 'long unsigned int'
  2023-05-06 21:22 [Bug ipa/109759] New: UBSAN error: shift exponent 64 is too large for 64-bit type 'long unsigned int' jamborm at gcc dot gnu.org
  2023-05-08  7:12 ` [Bug tree-optimization/109759] " rguenth at gcc dot gnu.org
@ 2023-05-10 11:10 ` jamborm at gcc dot gnu.org
  2023-05-17  8:44 ` jamborm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-05-10 11:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Likely a duplicate of PR 109788.

I'll close the bug as such if it does not manifest itself over the weekend
ubsan bootstrap.

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

* [Bug tree-optimization/109759] UBSAN error: shift exponent 64 is too large for 64-bit type 'long unsigned int'
  2023-05-06 21:22 [Bug ipa/109759] New: UBSAN error: shift exponent 64 is too large for 64-bit type 'long unsigned int' jamborm at gcc dot gnu.org
  2023-05-08  7:12 ` [Bug tree-optimization/109759] " rguenth at gcc dot gnu.org
  2023-05-10 11:10 ` jamborm at gcc dot gnu.org
@ 2023-05-17  8:44 ` jamborm at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jamborm at gcc dot gnu.org @ 2023-05-17  8:44 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Jambor <jamborm at gcc dot gnu.org> changed:

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

--- Comment #3 from Martin Jambor <jamborm at gcc dot gnu.org> ---
This test now passed with UBSAN instrumented compiler, so probably indeed a
dup.

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

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

end of thread, other threads:[~2023-05-17  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-06 21:22 [Bug ipa/109759] New: UBSAN error: shift exponent 64 is too large for 64-bit type 'long unsigned int' jamborm at gcc dot gnu.org
2023-05-08  7:12 ` [Bug tree-optimization/109759] " rguenth at gcc dot gnu.org
2023-05-10 11:10 ` jamborm at gcc dot gnu.org
2023-05-17  8:44 ` jamborm 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).