public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/9481: no imaginary long long constants
@ 2003-01-28 15:36 wesarg
  0 siblings, 0 replies; only message in thread
From: wesarg @ 2003-01-28 15:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9481
>Category:       c
>Synopsis:       no imaginary long long constants
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 28 15:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Bert Wesarg
>Release:        gcc-3.2.2-20030128
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
it is not possible to build complex long long constant with the GNU extension for the imaginary suffix and the long long suffix (see test file). i think this is only in the 3_2-branch, because in the 3_3-branch the file gcc/c-lex.c was rewritten

gcc putput:
$ gcc322p -v -save-temps pr.c
Reading specs from /opt/gcc-3.2.2pre/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs
Configured with: ../gcc-3.2.2-20030128/configure --enable-threads --enable-long-long --prefix=/opt/gcc-3.2.2pre --enable-languages=c --disable-nls --enable-shared --program-suffix=322p
Thread model: posix
gcc version 3.2.2 20030128 (prerelease)
 /opt/gcc-3.2.2pre/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/cpp0 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ pr.c pr.i
GNU CPP version 3.2.2 20030128 (prerelease) (cpplib) (i386 Linux/ELF)
ignoring nonexistent directory "/opt/gcc-3.2.2pre/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /opt/gcc-3.2.2pre/include
 /opt/gcc-3.2.2pre/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/include
 /usr/include
End of search list.
 /opt/gcc-3.2.2pre/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/cc1 -fpreprocessed pr.i -quiet -dumpbase pr.c -version -o pr.s
GNU CPP version 3.2.2 20030128 (prerelease) (cpplib) (i386 Linux/ELF)
GNU C version 3.2.2 20030128 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 3.2.2 20030128 (prerelease).
pr.c: In function `main':
pr.c:18: complex integer constant is too wide for 'complex int'
pr.c:24: complex integer constant is too wide for 'complex int'
>How-To-Repeat:
#include <complex.h>

int
main()
{
        complex int ci;
        complex long int cli;
        complex long long int clli;

        complex unsigned int cui;
        complex unsigned long int culi;
        complex unsigned long long int culli;

        ci = 1i;

        cli = 1li;

        clli = 1lli;

        cui = 1ui;

        culi = 1uli;

        culli = 1ulli;

        return 0;
}
>Fix:
--- gcc-3.2.2-20030128/gcc/c-lex.c      Fri Jun 28 00:27:09 2002
+++ gcc-3.2.2-20030128-pr/gcc/c-lex.c   Tue Jan 28 14:24:27 2003
@@ -1266,6 +1266,14 @@
              <= TYPE_PRECISION (integer_type_node))
            value = build_complex (NULL_TREE, integer_zero_node,
                                   convert (integer_type_node, value));
+         else if (TYPE_PRECISION (type)
+             <= TYPE_PRECISION (long_integer_type_node))
+           value = build_complex (NULL_TREE, integer_zero_node,
+                                  convert (long_integer_type_node, value));
+         else if (TYPE_PRECISION (type)
+             <= TYPE_PRECISION (long_long_integer_type_node))
+           value = build_complex (NULL_TREE, integer_zero_node,
+                                  convert (long_long_integer_type_node, value));
          else
            ERROR ("complex integer constant is too wide for 'complex int'");
        }
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="pr.i.bz2"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="pr.i.bz2"

QlpoOT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DdpFd6OrUe3m5yJHRykTl5X23LL4zdMCj0j1AqusYBEIG9Aqth/i
7kinChIXWbRwQA==


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-01-28 15:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-28 15:36 c/9481: no imaginary long long constants wesarg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).