public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60858] New: 64-bit multi-character constants
@ 2014-04-16  8:25 swissp2013 at gmail dot com
  2014-04-16  8:32 ` [Bug c/60858] " pinskia at gcc dot gnu.org
  2014-07-25 19:20 ` [Bug preprocessor/60858] " 3dw4rd at verizon dot net
  0 siblings, 2 replies; 3+ messages in thread
From: swissp2013 at gmail dot com @ 2014-04-16  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60858
           Summary: 64-bit multi-character constants
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: swissp2013 at gmail dot com

Hello All,

There are several real-life cases for 64-bit multi-character constants (ie:
hash tables) that are better handled by the pre-processor (before machine code
generation).

It is trivial for GCC users to resolve the 'per-implementation' behavior
(big-endian vs ...) but they need 64-bit support in the first place.

Currently, a macro has been used to concatenate 32-bit values but this is
adding unecessary bloat in people's C source code.

The GCC 'enhancement' is trivial to make:
---------------------------------------------------------
in gcc-4.9-20140406/libcpp/charset.c:

line 1482:
- size_t max_chars = CPP_OPTION (pfile, int_precision) / width;
+ size_t max_chars = (CHAR_BIT * sizeof (long long int)) / width;

line 1529:
- width = CPP_OPTION(pfile, int_precision);
- width = (CHAR_BIT * sizeof (long long int)) / width;
---------------------------------------------------------

This change won't break existing code - and the warnings will remain - so there
is only a benefit for greybeards like us.

Thank you for your consideration.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/60858] 64-bit multi-character constants
  2014-04-16  8:25 [Bug c/60858] New: 64-bit multi-character constants swissp2013 at gmail dot com
@ 2014-04-16  8:32 ` pinskia at gcc dot gnu.org
  2014-07-25 19:20 ` [Bug preprocessor/60858] " 3dw4rd at verizon dot net
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-04-16  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Doing A('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'); is not that bloated and works
independent of the endian.

Also patches go to gcc-patches@ and should include a testcase or two.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug preprocessor/60858] 64-bit multi-character constants
  2014-04-16  8:25 [Bug c/60858] New: 64-bit multi-character constants swissp2013 at gmail dot com
  2014-04-16  8:32 ` [Bug c/60858] " pinskia at gcc dot gnu.org
@ 2014-07-25 19:20 ` 3dw4rd at verizon dot net
  1 sibling, 0 replies; 3+ messages in thread
From: 3dw4rd at verizon dot net @ 2014-07-25 19:20 UTC (permalink / raw)
  To: gcc-bugs

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

Ed Smith-Rowland <3dw4rd at verizon dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |3dw4rd at verizon dot net

--- Comment #3 from Ed Smith-Rowland <3dw4rd at verizon dot net> ---
You send a message containing a patch (which should include a test case) an
explanation for the change (explanation of method if needed,
motivation/rationale for addition) and a ChangeLog entry to 
gcc-patches@gcc.gnu.org.  You'll need Copyright paperwork too.

Basically, see https://gcc.gnu.org/contribute.html.

Having said that, at least C++ has standard language specifying 'int' for
multi-character char constants.  So I think you'll need to enable this with a
flag, -flong-long-multicharacter-const, maybe.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-25 19:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16  8:25 [Bug c/60858] New: 64-bit multi-character constants swissp2013 at gmail dot com
2014-04-16  8:32 ` [Bug c/60858] " pinskia at gcc dot gnu.org
2014-07-25 19:20 ` [Bug preprocessor/60858] " 3dw4rd at verizon dot net

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).