[Bug c++/78949] New: incorrect "unused variable" warning with SSE2

jens.maurer at gmx dot net gcc-bugzilla@gcc.gnu.org
Thu Dec 29 10:13:00 GMT 2016


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

            Bug ID: 78949
           Summary: incorrect "unused variable" warning with SSE2
           Product: gcc
           Version: 6.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jens.maurer at gmx dot net
  Target Milestone: ---

The following program:

typedef unsigned char xmmb_t __attribute__((vector_size(16)));

void f()
{
  xmmb_t bla = { };
  xmmb_t x = { };
  bla &= ~x;
}


yields an "unused variable" warning, although "x" is obviously used.


$ g++ -v -Wunused -c unused.cc 
gcc version 6.2.0 (GCC)

unused.cc: In function ‘void f()’:
unused.cc:7:10: warning: variable ‘x’ set but not used
[-Wunused-but-set-variable]
   xmmb_t x = { };


More information about the Gcc-bugs mailing list