public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61872] Assigning to "long double" causes memset to be improperly elided
       [not found] <bug-61872-4@http.gcc.gnu.org/bugzilla/>
@ 2014-07-23 12:23 ` rguenth at gcc dot gnu.org
  2014-07-23 12:38 ` [Bug target/61872] " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-07-23 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-07-23
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed, mine.

int main()
{
  long double a;
  __builtin_memset(&a, '\0', sizeof(long double));
  a = 1.0;

  long double b;
  __builtin_memset(&b, '\0', sizeof(long double));
  b = 1.0;

  if (__builtin_memcmp(&a, &b, sizeof(long double)))
    __builtin_abort ();
  return 0;
}


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

* [Bug target/61872] Assigning to "long double" causes memset to be improperly elided
       [not found] <bug-61872-4@http.gcc.gnu.org/bugzilla/>
  2014-07-23 12:23 ` [Bug c++/61872] Assigning to "long double" causes memset to be improperly elided rguenth at gcc dot gnu.org
@ 2014-07-23 12:38 ` rguenth at gcc dot gnu.org
  2020-03-15 22:03 ` ch3root at openwall dot com
  2020-03-20 14:25 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-07-23 12:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Old value = 12 '\f'
New value = 16 '\020'
init_adjust_machine_modes () at insn-modes.c:1069
1066      /* config/i386/i386-modes.def:34 */
1067      s = TARGET_128BIT_LONG_DOUBLE ? 16 : 12;
1068      mode_size[XFmode] = s;
1069      mode_base_align[XFmode] = s & (~s + 1);

/* In ILP32 mode, XFmode has size 12 and alignment 4.
   In LP64 mode, XFmode has size and alignment 16.  */
ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_LONG_DOUBLE
                          ? &ieee_extended_intel_128_format
                          : TARGET_96_ROUND_53_LONG_DOUBLE
                          ? &ieee_extended_intel_96_round_53_format
                          : &ieee_extended_intel_96_format));

ok, but with that you need to adjust the insns to actually store 16bits.

Target bug.


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

* [Bug target/61872] Assigning to "long double" causes memset to be improperly elided
       [not found] <bug-61872-4@http.gcc.gnu.org/bugzilla/>
  2014-07-23 12:23 ` [Bug c++/61872] Assigning to "long double" causes memset to be improperly elided rguenth at gcc dot gnu.org
  2014-07-23 12:38 ` [Bug target/61872] " rguenth at gcc dot gnu.org
@ 2020-03-15 22:03 ` ch3root at openwall dot com
  2020-03-20 14:25 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: ch3root at openwall dot com @ 2020-03-15 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

Alexander Cherepanov <ch3root at openwall dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ch3root at openwall dot com

--- Comment #4 from Alexander Cherepanov <ch3root at openwall dot com> ---
This looks like a dup of pr93270, so:
- this is invalid because assignments can change padding;
- this is probably fixed together with pr94103.

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

* [Bug target/61872] Assigning to "long double" causes memset to be improperly elided
       [not found] <bug-61872-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-03-15 22:03 ` ch3root at openwall dot com
@ 2020-03-20 14:25 ` rguenth at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-03-20 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Indeed this one is invalid, the padding becomes undefined after the
long double store.

*** This bug has been marked as a duplicate of bug 93270 ***

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

end of thread, other threads:[~2020-03-20 14:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-61872-4@http.gcc.gnu.org/bugzilla/>
2014-07-23 12:23 ` [Bug c++/61872] Assigning to "long double" causes memset to be improperly elided rguenth at gcc dot gnu.org
2014-07-23 12:38 ` [Bug target/61872] " rguenth at gcc dot gnu.org
2020-03-15 22:03 ` ch3root at openwall dot com
2020-03-20 14:25 ` rguenth at gcc dot gnu.org

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