public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/32617]  New: explow.c references DECL_ALIGN of a FUNCTION_DECL
@ 2007-07-03 20:56 geoffk at gcc dot gnu dot org
  2007-07-03 21:06 ` [Bug bootstrap/32617] " rguenth at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2007-07-03 20:56 UTC (permalink / raw)
  To: gcc-bugs

In explow.c, there's this code:

    if (GET_CODE (x) == SYMBOL_REF)
      {
        align = BITS_PER_UNIT;
        if (SYMBOL_REF_DECL (x) && DECL_P (SYMBOL_REF_DECL (x)))
          align = DECL_ALIGN (SYMBOL_REF_DECL (x));
      }

If SYMBOL_REF_DECL(x) is a FUNCTION_DECL, DECL_ALIGN() does not have valid
data, so this code will cause the alignment of a function's MEM to be set to
random data.


-- 
           Summary: explow.c references DECL_ALIGN of a FUNCTION_DECL
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: geoffk at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug bootstrap/32617] explow.c references DECL_ALIGN of a FUNCTION_DECL
  2007-07-03 20:56 [Bug bootstrap/32617] New: explow.c references DECL_ALIGN of a FUNCTION_DECL geoffk at gcc dot gnu dot org
@ 2007-07-03 21:06 ` rguenth at gcc dot gnu dot org
  2007-07-03 21:53 ` geoffk at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-07-03 21:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-07-03 21:05 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-07-03 21:05:56
               date|                            |


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


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

* [Bug bootstrap/32617] explow.c references DECL_ALIGN of a FUNCTION_DECL
  2007-07-03 20:56 [Bug bootstrap/32617] New: explow.c references DECL_ALIGN of a FUNCTION_DECL geoffk at gcc dot gnu dot org
  2007-07-03 21:06 ` [Bug bootstrap/32617] " rguenth at gcc dot gnu dot org
@ 2007-07-03 21:53 ` geoffk at gcc dot gnu dot org
  2007-07-10 23:09 ` geoffk at gcc dot gnu dot org
  2007-07-21  8:36 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2007-07-03 21:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

geoffk at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |geoffk at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-07-03 21:05:56         |2007-07-03 21:53:07
               date|                            |


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


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

* [Bug bootstrap/32617] explow.c references DECL_ALIGN of a FUNCTION_DECL
  2007-07-03 20:56 [Bug bootstrap/32617] New: explow.c references DECL_ALIGN of a FUNCTION_DECL geoffk at gcc dot gnu dot org
  2007-07-03 21:06 ` [Bug bootstrap/32617] " rguenth at gcc dot gnu dot org
  2007-07-03 21:53 ` geoffk at gcc dot gnu dot org
@ 2007-07-10 23:09 ` geoffk at gcc dot gnu dot org
  2007-07-21  8:36 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2007-07-10 23:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from geoffk at gcc dot gnu dot org  2007-07-10 23:09 -------
Subject: Bug 32617

Author: geoffk
Date: Tue Jul 10 23:08:52 2007
New Revision: 126529

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126529
Log:
2007-07-09  Geoffrey Keating  <geoffk@apple.com>

        PR 32617
        * c-common.c (c_alignof_expr): Look at DECL_ALIGN of
        FUNCTION_DECLs.
        (handle_aligned_attribute): Allow use on FUNCTION_DECLs.
        * varasm.c (assemble_start_function): Honor DECL_ALIGN
        for FUNCTION_DECLs.  Don't use align_functions_log if
        DECL_USER_ALIGN.
        * print-tree.c (print_node): Print DECL_ALIGN and DECL_USER_ALIGN
        even for FUNCTION_DECLs.
        * c-decl.c (merge_decls): Propagate DECL_ALIGN even for
        FUNCTION_DECLs.
        * tree.h (DECL_ALIGN): Update for new location of 'align'.
        (DECL_FUNCTION_CODE): Update for new location and name of
        'function_code'.
        (DECL_OFFSET_ALIGN): Update for new location of 'off_align'.
        (struct tree_decl_common): Move 'align' and 'off_align' out
        of union, ensure they're still on a 32-bit boundary.  Remove
        other fields in union 'u1'.
        (struct tree_function_decl): Add field 'function_code' replacing
        'u1.f' in tree_decl_common.
        * tree.c (build_decl_stat): Set initial value of DECL_ALIGN.
        * doc/extend.texi (Function Attributes): Add 'aligned' attribute.
        (Variable Attributes): Cross-reference 'aligned' attribute
        to Function Attributes.
        * flags.h (force_align_functions_log): Delete.
        * toplev.c (force_align_functions_log): Delete.

Index: gcc/testsuite/ChangeLog
2007-07-09  Geoffrey Keating  <geoffk@apple.com>

        PR 32617
        * gcc.c-torture/execute/align-3.c: New.

Index: gcc/java/ChangeLog
2007-07-09  Geoffrey Keating  <geoffk@apple.com>

        PR 32617
        * lang.c (java_init): Remove setting of force_align_functions_log.
        * class.c (add_method_1): Set DECL_ALIGN of non-static method
        to cope with ptrmemfunc_vbit_in_pfn.

Index: gcc/cp/ChangeLog
2007-07-09  Geoffrey Keating  <geoffk@apple.com>

        PR 32617
        * decl.c (cxx_init_decl_processing): Don't set
        force_align_functions_log.
        (grokfndecl): Honour ptrmemfunc_vbit_in_pfn.
        * typeck.c (cxx_alignof_expr): When alignof is used on a plain
        FUNCTION_DECL, return its alignment.

Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/align-3.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-common.c
    trunk/gcc/c-decl.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/doc/extend.texi
    trunk/gcc/flags.h
    trunk/gcc/java/ChangeLog
    trunk/gcc/java/class.c
    trunk/gcc/java/lang.c
    trunk/gcc/print-tree.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/toplev.c
    trunk/gcc/tree.c
    trunk/gcc/tree.h
    trunk/gcc/varasm.c


-- 


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


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

* [Bug bootstrap/32617] explow.c references DECL_ALIGN of a FUNCTION_DECL
  2007-07-03 20:56 [Bug bootstrap/32617] New: explow.c references DECL_ALIGN of a FUNCTION_DECL geoffk at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-07-10 23:09 ` geoffk at gcc dot gnu dot org
@ 2007-07-21  8:36 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-21  8:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-07-21 08:35 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-07-21  8:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-03 20:56 [Bug bootstrap/32617] New: explow.c references DECL_ALIGN of a FUNCTION_DECL geoffk at gcc dot gnu dot org
2007-07-03 21:06 ` [Bug bootstrap/32617] " rguenth at gcc dot gnu dot org
2007-07-03 21:53 ` geoffk at gcc dot gnu dot org
2007-07-10 23:09 ` geoffk at gcc dot gnu dot org
2007-07-21  8:36 ` pinskia at gcc dot gnu dot 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).