r1 is not backed up when calling to naked function

Bug #1809607 reported by Alexander Zilberkant on 2018-12-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Undecided
Unassigned

Bug Description

According to AAPCS r1 register is a caller-save and can be used as a scratch register by called function.
Thus toolchain should generate registers backing up code in caller function , before branching to callee.

The problem is emphasized in PR https://github.com/ARMmbed/mbed-os/pull/9128

In our case, callee is a naked function (call_mem) which modifies r1 register. There are no instructions generated to backup up r1 register in test_memory() before branching to naked function.

Thus i assume it is a bug in a tool chain.

Ich bin bis 07.01. nicht im Haus und kann Ihre Nachricht daher leider nicht bearbeiten. In dringenden Fällen wenden Sie sich bitte an <email address hidden> bzw. für technische Fragen an <email address hidden>.

I am out of office until January 7th and won't be able to read your message. In urgent cases, please refer to <email address hidden> or for technical questions to <email address hidden>.

Mit freundlichen Grüßen / Best regards

Steffen Wolfer

--
Dipl.-Inform. Steffen Wolfer
Software Engineer Embedded Systems

WEISS ROBOTICS GmbH & Co. KG
Karl-Heinrich-Käferle-Str. 8
D-71640 Ludwigsburg, Germany

Phone: +49 7141 94702-22
Fax: +49 7141 94702-99
http://www.weiss-robotics.com

Sitz der Gesellschaft: Ludwigsburg
Registergericht Stuttgart, HRA725006

Pers. haftende Gesellschafterin:
Weiss Robotics Verwaltungs-GmbH, Sitz Ludwigsburg
Registergericht Stuttgart, HRB73310
Geschäftsführer: Dr. Karsten Weiß

Public bug reported:

According to AAPCS r1 register is a caller-save and can be used as a scratch register by called function.
Thus toolchain should generate registers backing up code in caller function , before branching to callee.

The problem is emphasized in PR https://github.com/ARMmbed/mbed-
os/pull/9128

In our case, callee is a naked function (call_mem) which modifies r1
register. There are no instructions generated to backup up r1 register
in test_memory() before branching to naked function.

Thus i assume it is a bug in a tool chain.

** Affects: gcc-arm-embedded
     Importance: Undecided
         Status: New

--
You received this bug notification because you are subscribed to GNU Arm
Embedded Toolchain.
Matching subscriptions: Älles
https://bugs.launchpad.net/bugs/1809607

Title:
  r1 is not backed up when calling to naked function

Status in GNU Arm Embedded Toolchain:
  New

Bug description:
  According to AAPCS r1 register is a caller-save and can be used as a scratch register by called function.
  Thus toolchain should generate registers backing up code in caller function , before branching to callee.

  The problem is emphasized in PR https://github.com/ARMmbed/mbed-
  os/pull/9128

  In our case, callee is a naked function (call_mem) which modifies r1
  register. There are no instructions generated to backup up r1 register
  in test_memory() before branching to naked function.

  Thus i assume it is a bug in a tool chain.

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc-arm-embedded/+bug/1809607/+subscriptions

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers