Bug 95227 - vec_extract doesn't mark input as used in C++ mode
Summary: vec_extract doesn't mark input as used in C++ mode
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks: 100677
  Show dependency treegraph
 
Reported: 2020-05-20 00:25 UTC by Evan Nemerson
Modified: 2021-05-22 23:05 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evan Nemerson 2020-05-20 00:25:07 UTC
Pretty straightforward.  With -maltivec -Wunused-but-set-parameter, this works in C but emits a diagnostic in C++:

  #include <altivec.h>
  int f(vector int b) {
    return vec_extract(b, 0);
  }

FWIW, the same problem happens if b is a local variable not a parameter, though of course it will emit an unused-but-set-variable diagnostic instead.