Issue Details (XML | Word | Printable)

Key: PCC-57
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Anders Magnusson
Reporter: TAKAHASHI Tamotsu
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.

_Complex constant value is not handled as a constant on initialization

Created: 31/May/09 09:26 AM   Updated: 01/May/14 03:55 PM
Component/s: C frontend
Affects Version/s: None
Fix Version/s: None

Environment: OpenBSD

 Description  « Hide
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.

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 31/May/09 09:58 AM
It is a bug, yes, thanks for reporting it. The complex constant evaluation might need some help.

Anders Magnusson added a comment - 27/Jun/10 05:45 PM
This require a redesign of the internals. Not now.

Anders Magnusson added a comment - 01/May/14 03:55 PM
No requirement to do compile-time evaluation of complex constants. May fix this in the future.