For integral complex types like complex int, GCC doesn't fold division with
constant arguments.  E.g. this testcase should evaluate at compile-time and
link without any errors but doesn't:

extern void link_error(void);
#define EXPR ((2 + 4i) / 2)
int main(void)
{
  if (__real EXPR != 1 || __imag EXPR != 2)
    link_error();

  return 0;
}


-- 
           Summary: GCC doesn't fold complex int division
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ghazi at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41435

Reply via email to