[Bug target/100331] 128 bit arithmetic --- suboptimal after shifting when referencing other variables

2021-04-29 Thread mbenfield at google dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100331

Michael Benfield  changed:

   What|Removed |Added

 CC||mbenfield at google dot com

--- Comment #2 from Michael Benfield  ---
Given code with unused variables/parameters of some struct type in C that warns
for `-Wunused-variable`, the identical code warns in C++. But the same is not
true of `-Wunused-but-set-variable`: code that warns in C will not warn in C++.
This seems inconsistent to me; I suspect the code should warn in both
languages.

Similar comments apply to `-Wunused-parameter` and
`-Wunused-but-set-parameter`. 

Given this code in both gcc-test.c and gcc-test.cpp:

struct S { 
  int x;
};

void f_unused_but_set(struct S p1) {
  struct S s;
  p1 = s; 

  struct S v1;
  v1 = s;
} 

void f_unused(struct S p2) { 
  struct S v2; 
}

and compiling with `gcc -fsyntax-only -Wunused -Wextra gcc-test.c`, for
gcc-test.c, we get warnings for all of p1, v1, p2, v2, while for gcc-test.cpp
we get warnings only for p2 and v2.

[Bug target/100331] 128 bit arithmetic --- suboptimal after shifting when referencing other variables

2021-04-29 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100331

Richard Biener  changed:

   What|Removed |Added

   Last reconfirmed||2021-04-29
  Known to fail||12.0
 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
 Target||x86_64-*-*
   Keywords||missed-optimization

--- Comment #1 from Richard Biener  ---
Confirmed with GCC head.