[all-commits] [llvm/llvm-project] 8b1e81: [builtins] Fix -Wshift-count-overflow warnings for...

mikaelholmen via All-commits all-commits at lists.llvm.org
Sun Apr 16 23:58:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b1e81f03c0413ce25081dc5cd6b9e00376e7ddb
      https://github.com/llvm/llvm-project/commit/8b1e81f03c0413ce25081dc5cd6b9e00376e7ddb
  Author: Mikael Holmen <mikael.holmen at ericsson.com>
  Date:   2023-04-17 (Mon, 17 Apr 2023)

  Changed paths:
    M compiler-rt/lib/builtins/floattidf.c
    M compiler-rt/lib/builtins/floattisf.c
    M compiler-rt/lib/builtins/floatuntidf.c
    M compiler-rt/lib/builtins/floatuntisf.c

  Log Message:
  -----------
  [builtins] Fix -Wshift-count-overflow warnings for targets with 16-bit int

Without this fix we got warnings like
 /repo/llvm/compiler-rt/lib/builtins/floattidf.c:67:29: warning: shift count >= width of type [-Wshift-count-overflow]
                 ((e + 1023) << 20) |              // exponent
                             ^  ~~
 1 warning generated.
when compiling for a target with 16-bit int.

In floatundisf.c the type of "e" was already changed to "si_int" in
4d41df6482, now we do the same in a couple of other files where "e" is
also left shifted 20/23 steps.

Differential Revision: https://reviews.llvm.org/D147509




More information about the All-commits mailing list