[Bug admin/10767] New: opcodes/i386-dis.c exceeds 256 levels of nested macros

View: New views
14 Messages — Rating Filter:   Alert me  

[Bug admin/10767] New: opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is not a bug, rather to inform that the current solution breaks the
MS x64 compiler <= 15.00.30729.01. There is a limit of max 256 levels
of nested macros. The Intel compiler v11.1 do not have this limit,
neither do gcc.

As there are no functional 64bit gcc for PE targets and the Intel
compiler is not fully compatible with NT POSIX, the only current
possible choice is the MS compiler to get 64bit binaries.

Here is a simple solution to get it working:
Preprocess opcodes/i386-dis.c with the Intel compiler.
Extract "struct dis386 vex_table" to opcodes/i386-dis_tables.c
Apply the following patch:

===================================================================
RCS file: /cvs/src/src/opcodes/i386-dis.c,v
retrieving revision 1.200
diff -w -b -B -u -p -r1.200 i386-dis.c
--- i386-dis.c 15 Sep 2009 17:53:40 -0000 1.200
+++ i386-dis.c 13 Oct 2009 02:17:19 -0000
@@ -6316,7 +6316,9 @@ static const struct dis386 three_byte_ta
   },
 };
 
-
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
+#include "i386-dis_tables.c"
+#else
 static const struct dis386 vex_table[][256] = {
   /* VEX_0F */
   {
@@ -7192,6 +7194,7 @@ static const struct dis386 vex_table[][2
     { "(bad)", { XX } },
   },
 };
+#endif
 
 static const struct dis386 vex_len_table[][2] = {
   /* VEX_LEN_10_P_1 */

--
           Summary: opcodes/i386-dis.c exceeds 256 levels of nested macros
           Product: binutils
           Version: 2.21 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: admin
        AssignedTo: drow at sources dot redhat dot com
        ReportedBy: jerker dot back at gmail dot com
                CC: bug-binutils at gnu dot org
 GCC build triplet: x86_64-unknown-interix6.1
  GCC host triplet: x86_64-unknown-interix6.1
GCC target triplet: x86_64-unknown-interix6.1


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From hjl dot tools at gmail dot com  2009-10-13 16:26 -------
The proposed solution isn't acceptable since vex_table is very dynamic.

--
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drow at sources dot redhat  |unassigned at sources dot
                   |dot com                     |redhat dot com
             Status|NEW                         |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From jerker dot back at gmail dot com  2009-10-13 16:51 -------
Oh, it was not meant as a fix. Just as an information.

--


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From hjl dot tools at gmail dot com  2009-10-14 14:56 -------
(In reply to comment #2)
> Oh, it was not meant as a fix. Just as an information.

You can try enum.

--


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From ineiev at gmail dot com  2009-10-15 16:03 -------
Subject: Re:  opcodes/i386-dis.c exceeds 256 levels of nested
        macros

On 10/14/09, hjl dot tools at gmail dot com
<sourceware-bugzilla@...> wrote:
>
>
> You can try enum.

Like via the attached sed script (I'm sorry, I should have sent it a
year ago); the script applies to current CVS default head revision.

Best regards,
Ineiev

------- Additional Comments From ineiev at gmail dot com  2009-10-15 16:03 -------
Created an attachment (id=4285)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4285&action=view)


--


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #4285|application/octet-stream    |application/text
          mime type|                            |


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #4285|application/text            |text/plain
          mime type|                            |


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From hjl dot tools at gmail dot com  2009-10-15 21:32 -------
(In reply to comment #5)
> Created an attachment (id=4285)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=4285&action=view)
>

Nice. Jerker, please give it a try.

--


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2009-10-15 22:50 -------
Subject: Bug 10767

CVSROOT: /cvs/src
Module name: src
Changes by: hjl@... 2009-10-15 22:50:09

Modified files:
        opcodes        : ChangeLog i386-dis.c

Log message:
        2009-10-15  H.J. Lu  <hongjiu.lu@...>
        Ineiev <ineiev@...>
       
        PR binutils/10767
        * i386-dis.c: Use enum instead of nested macros.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ChangeLog.diff?cvsroot=src&r1=1.1475&r2=1.1476
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/i386-dis.c.diff?cvsroot=src&r1=1.202&r2=1.203



--


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug admin/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From jerker dot back at gmail dot com  2009-10-15 23:32 -------
Problem solved, the code now compiles
Thanks!

--


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug binutils/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



--
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|admin                       |binutils


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils

[Bug binutils/10767] opcodes/i386-dis.c exceeds 256 levels of nested macros

by Bugzilla from sourceware-bugzilla@sourceware.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


------- Additional Comments From hjl dot tools at gmail dot com  2009-10-16 17:57 -------
Fixed.

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


http://sourceware.org/bugzilla/show_bug.cgi?id=10767

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


_______________________________________________
bug-binutils mailing list
bug-binutils@...
http://lists.gnu.org/mailman/listinfo/bug-binutils