<< Back to previous view

[PCC-57] _Complex constant value is not handled as a constant on initialization Created: 31/May/09  Updated: 01/May/14

Status: Closed
Project: pcc
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: TAKAHASHI Tamotsu Assignee: Anders Magnusson
Resolution: Won't Fix Votes: 0
Environment: OpenBSD

ccom fails to recognize "(complex constant) + constant" as a constant.

_Complex long double c0 = 1.1l; /* OK */
_Complex long double c1 = 2.2li; /* OK */
_Complex long double c2 = 1.1l + 2.2li; /* OK */
_Complex long double c3 = 1.1l + 2.2li + 3.3l; /* NG */
_Complex long double c4 = 2.2li + 1.1l; /* OK */
_Complex long double c5 = 2.2li + 1.1l + 3.3l; /* NG */
_Complex long double c6 = 1.1l + 1.1l + 1.1l + 2.2li; /* OK */
_Complex long double c7 = 2.2li + 2.2li + 2.2li + 1.1l; /* OK */

The error message is: "compiler error: ninval: init node not constant"

Ignore me if this isn't a bug, but gcc says it's okay.

Comment by Anders Magnusson [ 31/May/09 09:58 AM ]
It is a bug, yes, thanks for reporting it. The complex constant evaluation might need some help.
Comment by Anders Magnusson [ 27/Jun/10 05:45 PM ]
This require a redesign of the internals. Not now.
Comment by Anders Magnusson [ 01/May/14 03:55 PM ]
No requirement to do compile-time evaluation of complex constants. May fix this in the future.
Generated at Sat Oct 21 12:15:08 CEST 2017 using JIRA Enterprise Edition, Version: 3.13.1-#333.